diff options
| author | OpportunityLiu <[email protected]> | 2019-06-09 11:34:07 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-09 11:34:07 +0800 |
| commit | db9c880b656e33b056bd3e3804eb6009ea946fea (patch) | |
| tree | 1d5ee9423a1f128bd00085aa6e05441fc4939e20 /tests/runner.lua | |
| parent | dca7c26579f7d7857810b58f95e177877f9933fa (diff) | |
fix
Diffstat (limited to 'tests/runner.lua')
| -rw-r--r-- | tests/runner.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/runner.lua b/tests/runner.lua index f84b453ba..177bb865a 100644 --- a/tests/runner.lua +++ b/tests/runner.lua @@ -9,8 +9,8 @@ function main(script) script = path.join(script, "test.lua") end script = path.absolute(script) - assert(path.filename(script) == "test.lua") - assert(os.isfile(script)) + assert(path.filename(script) == "test.lua", "file should named `test.lua`") + assert(os.isfile(script), "should be a file") -- disable statistics os.setenv("XMAKE_STATS", "false") @@ -32,17 +32,17 @@ function main(script) -- trace cprint(">> testing %s ...", path.relative(root)) - -- enter script directory - local old_dir = os.cd(root) - -- get test functions - local data = import("test", { anonymous = true }) + local data = import("test", { rootdir = root, anonymous = true }) if data.main then -- ignore everthing when we found a main function data = { test_main = data.main } end + -- enter script directory + local old_dir = os.cd(root) + -- run test local succeed_count = 0 for k, v in pairs(data) do |
