Should now push non 0 exit codes

This commit is contained in:
Ryan Ward 2023-08-03 23:33:16 -04:00
parent d50c187710
commit 8c2bde7ed8
3 changed files with 10 additions and 4 deletions

View File

@ -2445,7 +2445,7 @@ end
multi.OnError=multi:newConnection() multi.OnError=multi:newConnection()
multi.OnPreLoad = multi:newConnection() multi.OnPreLoad = multi:newConnection()
multi.OnExit = multi:newConnection(nil,nil,true) 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 if _VERSION >= "Lua 5.2" or jit then
setmetatable(multi.m, {__gc = multi.m.onexit}) setmetatable(multi.m, {__gc = multi.m.onexit})

View File

@ -174,11 +174,16 @@ runTest = thread:newFunction(function()
multi.error("Connection Test 3: Error removing connection") multi.error("Connection Test 3: Error removing connection")
end end
if not love then if not love then
local ec = 0
multi.print("Testing pseudo threading") 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") multi.print("Testing lanes threading")
os.execute("lua tests/threadtests.lua l") ec = ec + os.execute("lua tests/threadtests.lua l")
os.exit() if ec > 0 then
os.exit(1)
else
os.exit()
end
end end
end) end)

View File

@ -255,6 +255,7 @@ multi:newThread("Scheduler Thread",function()
end).OnError(multi.error) end).OnError(multi.error)
multi.OnExit(function(err_or_errorcode) multi.OnExit(function(err_or_errorcode)
print("Error Code: ", err_or_errorcode)
if not we_good then if not we_good then
multi.info("There was an error running some tests!") multi.info("There was an error running some tests!")
return return