diff options
author | chai <chaifix@163.com> | 2021-10-20 13:36:36 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-20 13:36:36 +0800 |
commit | dde719dd575090b36aaa3ad85bb3cabf33f36c5a (patch) | |
tree | 3e0a8e70f716dbfee2f644f5202da7ee74b3c6b7 /Resources/Libraries/luaunit/run_unit_tests.lua | |
parent | 943411c9006345b07557e76ff360c388ee8366c1 (diff) |
+luaunit test
Diffstat (limited to 'Resources/Libraries/luaunit/run_unit_tests.lua')
-rw-r--r-- | Resources/Libraries/luaunit/run_unit_tests.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Resources/Libraries/luaunit/run_unit_tests.lua b/Resources/Libraries/luaunit/run_unit_tests.lua new file mode 100644 index 0000000..b5dcd70 --- /dev/null +++ b/Resources/Libraries/luaunit/run_unit_tests.lua @@ -0,0 +1,30 @@ +#!/usr/bin/env lua +if (os.getenv("_DEBUG")) then + local json = require 'json' + local debuggee = require 'vscode-debuggee' + + local startResult, breakerType = debuggee.start(json) + print('debuggee start ->', startResult, breakerType) +end + + +local no_error, err_msg +no_error, err_msg = pcall( require, 'test.test_luaunit') +if not no_error then + if nil == err_msg:find( "module 'test.test_luaunit' not found" ) then + -- module found but error loading it + -- display the error by reproducing it + require('test.test_luaunit') + end + + -- run_unit_tests shall also work when called directly from the test directory + require('test_luaunit') + + -- we must disable this test, not working in this case because it expects + -- the stack trace to start with test/test_luaunit.lua + TestLuaUnitUtilities.test_FailFmt = nil +end +local lu = require('luaunit') + +lu.LuaUnit.verbosity = 2 +os.exit( lu.LuaUnit.run() ) |