-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.kiwi
More file actions
48 lines (37 loc) · 967 Bytes
/
Copy pathtest.kiwi
File metadata and controls
48 lines (37 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/#
@file tests/test.kiwi
@summary Kiwi test runner — entry point for the full test suite.
Loads lib/testsuite.kiwi, which discovers and runs all test files under
tests/lib/suite/ and tests/lib/stdlib/, then prints a pass/fail summary.
Usage:
kiwi tests/test
Exit codes:
0 — all tests passed
1 — one or more tests failed
#/
fn main()
include "lib/testsuite"
println "Running Kiwi Test Suite v${testsuite::__version__()}...\n"
var (
results: list = tester::run_tests(),
succeeded: integer = 0,
failed: integer = 0,
duration: integer = 0
)
for r in results do
duration += r.duration
if r.result
succeeded += 1
else
failed += 1
end
end
println "\nRan ${results.size()} test(s) in ${math::round(duration, 2)}ms\n"
if failed == 0
println "All tests passed!"
else
println "${succeeded} tests passed, ${failed} tests failed."
exit 1
end
end
main()