summaryrefslogtreecommitdiff
path: root/Data/Libraries/luaunit/run_unit_tests.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-26 11:32:46 +0800
committerchai <chaifix@163.com>2021-10-26 11:32:46 +0800
commit0549b1e5a8a3132005e275d6026db8003cb067d2 (patch)
treef0d7751ec32ecf5c4d23997fa0ffd3450a5a755a /Data/Libraries/luaunit/run_unit_tests.lua
parent32345800737b668011a87328cd3dcce59ec2934c (diff)
*rename folder
Diffstat (limited to 'Data/Libraries/luaunit/run_unit_tests.lua')
-rw-r--r--Data/Libraries/luaunit/run_unit_tests.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/Data/Libraries/luaunit/run_unit_tests.lua b/Data/Libraries/luaunit/run_unit_tests.lua
new file mode 100644
index 0000000..b5dcd70
--- /dev/null
+++ b/Data/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() )