From 8c2bde7ed8648974321ede2270fec70274e0cf2b Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Thu, 3 Aug 2023 23:33:16 -0400 Subject: [PATCH] Should now push non 0 exit codes --- init.lua | 2 +- tests/runtests.lua | 11 ++++++++--- tests/threadtests.lua | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 7f2b811..aa7bb41 100644 --- a/init.lua +++ b/init.lua @@ -2445,7 +2445,7 @@ end multi.OnError=multi:newConnection() multi.OnPreLoad = multi:newConnection() multi.OnExit = multi:newConnection(nil,nil,true) -multi.m = {onexit = function() multi.OnExit:Fire() end} +multi.m = {onexit = function() os.exit() end} if _VERSION >= "Lua 5.2" or jit then setmetatable(multi.m, {__gc = multi.m.onexit}) diff --git a/tests/runtests.lua b/tests/runtests.lua index 988c978..c3d7df7 100644 --- a/tests/runtests.lua +++ b/tests/runtests.lua @@ -174,11 +174,16 @@ runTest = thread:newFunction(function() multi.error("Connection Test 3: Error removing connection") end if not love then + local ec = 0 multi.print("Testing pseudo threading") - os.execute("lua tests/threadtests.lua p") + ec = ec + os.execute("lua tests/threadtests.lua p") multi.print("Testing lanes threading") - os.execute("lua tests/threadtests.lua l") - os.exit() + ec = ec + os.execute("lua tests/threadtests.lua l") + if ec > 0 then + os.exit(1) + else + os.exit() + end end end) diff --git a/tests/threadtests.lua b/tests/threadtests.lua index 47fc9d3..1f871c6 100644 --- a/tests/threadtests.lua +++ b/tests/threadtests.lua @@ -255,6 +255,7 @@ multi:newThread("Scheduler Thread",function() end).OnError(multi.error) multi.OnExit(function(err_or_errorcode) + print("Error Code: ", err_or_errorcode) if not we_good then multi.info("There was an error running some tests!") return