forked from jamiejennings/rosie-pattern-language
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall.lua
31 lines (23 loc) · 934 Bytes
/
all.lua
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
---- -*- Mode: Lua; -*-
----
---- all.lua run all tests
----
---- © Copyright IBM Corporation 2016.
---- LICENSE: MIT License (https://opensource.org/licenses/mit-license.html)
---- AUTHOR: Jamie A. Jennings
test = require "test-functions"
json = require "cjson"
local results = {}
function do_test(fn)
table.insert(results, {fn, dofile(fn)})
end
do_test(ROSIE_HOME .. "/test/api-test.lua")
do_test(ROSIE_HOME .. "/test/rpl-core-test.lua")
do_test(ROSIE_HOME .. "/test/cli-test.lua")
do_test(ROSIE_HOME .. "/test/eval-test.lua")
passed = test.print_grand_total(results)
-- When running Rosie interactively (i.e. development mode), do not exit. Otherwise, these tests
-- were launched from the command line, so we should exit with an informative status.
if not ROSIE_DEV then
if passed then os.exit(0) else os.exit(-1); end
end