test updates

- update main love readme to include note on tests
- added module tests for Sensor, Keyboard, Touch, Joystick, Mouse, and Love (for hooks + basic love-level methods)
- general clean-up of main class logic
- couple fixes for runner-specific failures (physics.Joint, audio.getActiveSourceCount, mouse.getPosition)
- change window.close test to run last
This commit is contained in:
ell
2023-12-04 16:13:38 +00:00
parent 8951635abc
commit 2875a96e92
19 changed files with 2917 additions and 381 deletions
+7 -4
View File
@@ -33,9 +33,12 @@ TestSuite = {
graphics = {},
image = {},
joystick = {},
love = {},
keyboard = {},
math = {},
mouse = {},
physics = {},
sensor = {},
sound = {},
system = {},
thread = {},
@@ -60,7 +63,7 @@ TestSuite = {
-- stagger between tests
if self.module ~= nil then
if self.module.start == true then
if self.module.start then
-- work through each test method 1 by 1
if self.module.index <= #self.module.running then
@@ -70,13 +73,13 @@ TestSuite = {
self.module.called[self.module.index] = true
local method = self.module.running[self.module.index]
self.test = TestMethod:new(method, self.module)
TextRun:set('love.' .. self.module.module .. '.' .. method)
TextRun = 'love.' .. self.module.module .. '.' .. method
self.test.co = coroutine.create(function()
local ok, chunk, err = pcall(love.test[love.test.module.module][method], love.test.test)
if ok == false then
love.test.test.passed = false
love.test.test.fatal = tostring(chunk) .. tostring(err)
love.test.test['passed'] = false
love.test.test['fatal'] = tostring(chunk) .. tostring(err)
end
end)