Modified tests to make it more seamless

This commit is contained in:
2023-04-25 22:32:24 -04:00
parent 0e6c30b478
commit 9e1d31fc2a
4 changed files with 36 additions and 12 deletions
+6 -1
View File
@@ -1,2 +1,7 @@
require("runtests")
require("threadtests")
-- Allows you to run "love tests" which runs the tests
-- Allows you to run "love tests" which runs the tests
function love.update()
multi:uManager()
end
+16 -9
View File
@@ -22,7 +22,10 @@ end
]]
local multi, thread = require("multi"):init{print=true}--{priority=true}
local good = false
local proc = multi:newProcessor("Test",true)
local proc = multi:newProcessor("Test")
proc.Start()
proc:newAlarm(3):OnRing(function()
good = true
end)
@@ -163,23 +166,27 @@ runTest = thread:newFunction(function()
end
c3 = false
c4 = false
d:Destroy()
conn3:Unconnect(d)
conn3:Fire()
if c3 and not(c4) then
print("Connection Test 3: Ok")
else
print("Connection Test 3: Error removing connection")
end
os.exit() -- End of tests
if not love then
print("Testing pseudo threading")
os.execute("lua tests/threadtests.lua p")
print("Testing lanes threading")
os.execute("lua tests/threadtests.lua l")
os.exit()
end
end)
print(runTest().OnError(function(...)
runTest().OnError(function(...)
print("Error: Something went wrong with the test!")
print(...)
os.exit(1)
end))
end)
print("Pumping proc")
while true do
proc.run()
if not love then
multi:mainloop()
end
+6
View File
@@ -7,6 +7,12 @@ local env
if love then
GLOBAL, THREAD = require("multi.integration.loveManager"):init()
env = LOVE
elseif arg[1] == "l" then
GLOBAL, THREAD = require("multi.integration.lanesManager"):init()
env = LANES
elseif arg[1] == "p" then
GLOBAL, THREAD = require("multi.integration.pseudoManager"):init()
env = PSEUDO
else
io.write("Test Pseudo(p), Lanes(l), or love(Run in love environment) Threading: ")
choice = io.read()