Skip to content

Commit b1592cd

Browse files
committed
Improve test runner
The test runner was not reporting errors correctly. The error code wasn't being propagated.
1 parent 3e01160 commit b1592cd

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

unittest/run.lua

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
local lunit = require "lunit"
2-
local console = require "lunit-console"
32

43
package.path = "../src/?.lua;../src/?/init.lua;".. package.path
54

65
require "test"
76

8-
lunit.setrunner({
9-
fail = function(...)
10-
print(...)
11-
end,
12-
err = function(...)
13-
print(...)
14-
end,
15-
})
16-
17-
console.begin()
18-
lunit.run()
19-
console.done()
7+
local stats = lunit.main()
8+
if stats.errors > 0 or stats.failed > 0 then
9+
os.exit(1)
10+
end

0 commit comments

Comments
 (0)