Skip to content

Commit 72adac4

Browse files
committed
Throw error on test failure
1 parent 145ae2a commit 72adac4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Tests/Cli.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/-! Integration tests for the Ix CLI -/
22

3-
def Tests.Cli.run (buildCmd: String) (buildArgs : Array String) (buildDir : Option System.FilePath) : IO UInt32 := do
3+
def Tests.Cli.run (buildCmd: String) (buildArgs : Array String) (buildDir : Option System.FilePath) : IO Unit := do
44
let proc : IO.Process.SpawnArgs :=
55
match buildDir with
66
| some bd => { cmd := buildCmd, args := buildArgs, cwd := bd }
77
| none => { cmd := buildCmd, args := buildArgs }
88
let out ← IO.Process.output proc
99
if out.exitCode ≠ 0 then
1010
IO.eprintln out.stderr
11+
throw $ IO.userError out.stderr
1112
else
1213
IO.println out.stdout
13-
return out.exitCode
1414

1515
def Tests.Cli.suite : IO UInt32 := do
16-
let _install ← Tests.Cli.run "lake" (#["run", "install"]) none
16+
Tests.Cli.run "lake" (#["run", "install"]) none
1717
let ixTestDir := (← IO.currentDir) / "ix_test"
18-
let _store ← Tests.Cli.run "ix" (#["store", "IxTest.lean"]) (some ixTestDir)
19-
let _prove ← Tests.Cli.run "ix" (#["prove", "IxTest.lean", "one"]) (some ixTestDir)
18+
Tests.Cli.run "ix" (#["store", "IxTest.lean"]) (some ixTestDir)
19+
Tests.Cli.run "ix" (#["prove", "IxTest.lean", "one"]) (some ixTestDir)
2020
return 0

0 commit comments

Comments
 (0)