summaryrefslogtreecommitdiff
path: root/tests/test.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-08 13:34:02 +0800
committerOpportunityLiu <[email protected]>2019-06-08 13:34:02 +0800
commit1af88102687e493cab40e62b0a2b8b7d42417ae6 (patch)
tree272a80b424e68024a9ecda138159864d9659fe5a /tests/test.lua
parente165a8e43abed4eb2eca64c3b5adefb57cd65600 (diff)
improve test lib
Diffstat (limited to 'tests/test.lua')
-rw-r--r--tests/test.lua48
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/test.lua b/tests/test.lua
deleted file mode 100644
index faa7755e0..000000000
--- a/tests/test.lua
+++ /dev/null
@@ -1,48 +0,0 @@
--- imports
-import("core.project.task")
-
--- run test with the given name
-function _run_test(name)
-
- -- find the test script
- for _, script in ipairs(os.files(path.join(os.scriptdir(), "**", name, "test.lua"))) do
-
- -- trace
- print("testing %s ...", script)
-
- -- enter script directory
- os.cd(path.directory(script))
-
- -- run test
- task.run("lua", {script = path.filename(script)})
- break
- end
-end
-
--- main entry
-function main(name)
-
- -- disable statistics
- os.setenv("XMAKE_STATS", "false")
-
- -- run the given test
- if name then
- return _run_test(name)
- end
-
- -- run all tests
- for _, script in ipairs(os.files(path.join(os.scriptdir(), "**", "test.lua"))) do
-
- -- trace
- print("testing %s ...", script)
-
- -- enter script directory
- local oldir = os.cd(path.directory(script))
-
- -- run test
- task.run("lua", {script = path.filename(script)})
-
- -- leave script directory
- os.cd(oldir)
- end
-end