From 19df8040df98cdf4912aef110d1e99903616df14 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:43:44 +0100 Subject: [PATCH 01/54] 0.1 Initial commit of a basic test framework, see readme.md for more Most modules are covered with basic unit tests, and there's an example test for a graphics draw (rectangle) and object (File) - for object tests doing more scenario based so we can check multiple things together --- testing/classes/TestMethod.lua | 359 ++++++++++++++++ testing/classes/TestModule.lua | 114 ++++++ testing/classes/TestSuite.lua | 159 ++++++++ testing/conf.lua | 24 ++ testing/main.lua | 172 ++++++++ testing/output/lovetest_runAllTests.html | 1 + testing/output/lovetest_runAllTests.xml | 385 ++++++++++++++++++ testing/readme.md | 139 +++++++ testing/resources/click.ogg | Bin 0 -> 7824 bytes testing/resources/font.ttf | Bin 0 -> 10390 bytes testing/resources/love.dxt1 | Bin 0 -> 2872 bytes testing/resources/love.png | Bin 0 -> 680 bytes .../love_test_graphics_rectangle_expected.png | Bin 0 -> 135 bytes testing/resources/sample.ogv | Bin 0 -> 23845 bytes testing/resources/test.txt | 1 + testing/resources/test.zip | Bin 0 -> 150 bytes testing/tests/audio.lua | 296 ++++++++++++++ testing/tests/data.lua | 182 +++++++++ testing/tests/event.lua | 73 ++++ testing/tests/filesystem.lua | 354 ++++++++++++++++ testing/tests/font.lua | 54 +++ testing/tests/graphics.lua | 158 +++++++ testing/tests/image.lua | 31 ++ testing/tests/math.lua | 178 ++++++++ testing/tests/objects.lua | 175 ++++++++ testing/tests/physics.lua | 306 ++++++++++++++ testing/tests/sound.lua | 19 + testing/tests/system.lua | 68 ++++ testing/tests/thread.lua | 28 ++ testing/tests/timer.lua | 45 ++ testing/tests/video.lua | 10 + testing/tests/window.lua | 336 +++++++++++++++ 32 files changed, 3667 insertions(+) create mode 100644 testing/classes/TestMethod.lua create mode 100644 testing/classes/TestModule.lua create mode 100644 testing/classes/TestSuite.lua create mode 100644 testing/conf.lua create mode 100644 testing/main.lua create mode 100644 testing/output/lovetest_runAllTests.html create mode 100644 testing/output/lovetest_runAllTests.xml create mode 100644 testing/readme.md create mode 100644 testing/resources/click.ogg create mode 100644 testing/resources/font.ttf create mode 100644 testing/resources/love.dxt1 create mode 100644 testing/resources/love.png create mode 100644 testing/resources/love_test_graphics_rectangle_expected.png create mode 100644 testing/resources/sample.ogv create mode 100644 testing/resources/test.txt create mode 100644 testing/resources/test.zip create mode 100644 testing/tests/audio.lua create mode 100644 testing/tests/data.lua create mode 100644 testing/tests/event.lua create mode 100644 testing/tests/filesystem.lua create mode 100644 testing/tests/font.lua create mode 100644 testing/tests/graphics.lua create mode 100644 testing/tests/image.lua create mode 100644 testing/tests/math.lua create mode 100644 testing/tests/objects.lua create mode 100644 testing/tests/physics.lua create mode 100644 testing/tests/sound.lua create mode 100644 testing/tests/system.lua create mode 100644 testing/tests/thread.lua create mode 100644 testing/tests/timer.lua create mode 100644 testing/tests/video.lua create mode 100644 testing/tests/window.lua diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua new file mode 100644 index 000000000..b0c763082 --- /dev/null +++ b/testing/classes/TestMethod.lua @@ -0,0 +1,359 @@ +-- @class - TestMethod +-- @desc - used to run a specific method from a module's /test/ suite +-- each assertion is tracked and then printed to output +TestMethod = { + + + -- @method - TestMethod:new() + -- @desc - create a new TestMethod object + -- @param {string} method - string of method name to run + -- @param {TestMethod} testmethod - parent testmethod this test belongs to + -- @return {table} - returns the new Test object + new = function(self, method, testmodule) + local test = { + testmodule = testmodule, + method = method, + asserts = {}, + start = love.timer.getTime(), + finish = 0, + count = 0, + passed = false, + skipped = false, + skipreason = '', + fatal = '', + message = nil, + result = {}, + colors = { + red = {1, 0, 0, 1}, + green = {0, 1, 0, 1}, + blue = {0, 0, 1, 1}, + black = {0, 0, 0, 1}, + white = {1, 1, 1, 1} + } + } + setmetatable(test, self) + self.__index = self + return test + end, + + + -- @method - TestMethod:assertEquals() + -- @desc - used to assert two values are equals + -- @param {any} expected - expected value of the test + -- @param {any} actual - actual value of the test + -- @param {string} label - label for this test to use in exports + -- @return {nil} + assertEquals = function(self, expected, actual, label) + self.count = self.count + 1 + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = expected == actual, + message = 'expected \'' .. tostring(expected) .. '\' got \'' .. + tostring(actual) .. '\'', + test = label + }) + end, + + + -- @method - TestMethod:assertPixels() + -- @desc - checks a list of coloured pixels agaisnt given imgdata + -- @param {ImageData} imgdata - image data to check + -- @param {table} pixels - map of colors to list of pixel coords, i.e. + -- { blue = { {1, 1}, {2, 2}, {3, 4} } } + -- @return {nil} + assertPixels = function(self, imgdata, pixels, label) + for i, v in pairs(pixels) do + local col = self.colors[i] + local pixels = v + for p=1,#pixels do + local coord = pixels[p] + local tr, tg, tb, ta = imgdata:getPixel(coord[1], coord[2]) + local compare_id = tostring(coord[1]) .. ',' .. tostring(coord[2]) + -- @TODO add some sort pixel tolerance to the coords + self:assertEquals(col[1], tr, 'check pixel r for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') + self:assertEquals(col[2], tg, 'check pixel g for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') + self:assertEquals(col[3], tb, 'check pixel b for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') + self:assertEquals(col[4], ta, 'check pixel a for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') + end + end + end, + + + -- @method - TestMethod:assertNotEquals() + -- @desc - used to assert two values are not equal + -- @param {any} expected - expected value of the test + -- @param {any} actual - actual value of the test + -- @param {string} label - label for this test to use in exports + -- @return {nil} + assertNotEquals = function(self, expected, actual, label) + self.count = self.count + 1 + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = expected ~= actual, + message = 'avoiding \'' .. tostring(expected) .. '\' got \'' .. + tostring(actual) .. '\'', + test = label + }) + end, + + + -- @method - TestMethod:assertRange() + -- @desc - used to check a value is within an expected range + -- @param {number} actual - actual value of the test + -- @param {number} min - minimum value the actual should be >= to + -- @param {number} max - maximum value the actual should be <= to + -- @param {string} label - label for this test to use in exports + -- @return {nil} + assertRange = function(self, actual, min, max, label) + self.count = self.count + 1 + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = actual >= min and actual <= max, + message = 'value \'' .. tostring(actual) .. '\' out of range \'' .. + tostring(min) .. '-' .. tostring(max) .. '\'', + test = label + }) + end, + + + -- @method - TestMethod:assertMatch() + -- @desc - used to check a value is within a list of values + -- @param {number} list - list of valid values for the test + -- @param {number} actual - actual value of the test to check is in the list + -- @param {string} label - label for this test to use in exports + -- @return {nil} + assertMatch = function(self, list, actual, label) + self.count = self.count + 1 + local found = false + for l=1,#list do + if list[l] == actual then found = true end; + end + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = found == true, + message = 'value \'' .. tostring(actual) .. '\' not found in \'' .. + table.concat(list, ',') .. '\'', + test = label + }) + end, + + + -- @method - TestMethod:assertGreaterEqual() + -- @desc - used to check a value is >= than a certain target value + -- @param {any} target - value to check the test agaisnt + -- @param {any} actual - actual value of the test + -- @param {string} label - label for this test to use in exports + -- @return {nil} + assertGreaterEqual = function(self, target, actual, label) + self.count = self.count + 1 + local passing = false + if target ~= nil and actual ~= nil then + passing = actual >= target + end + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = passing, + message = 'value \'' .. tostring(actual) .. '\' not >= \'' .. + tostring(target) .. '\'', + test = label + }) + end, + + + -- @method - TestMethod:assertLessEqual() + -- @desc - used to check a value is <= than a certain target value + -- @param {any} target - value to check the test agaisnt + -- @param {any} actual - actual value of the test + -- @param {string} label - label for this test to use in exports + -- @return {nil} + assertLessEqual = function(self, target, actual, label) + self.count = self.count + 1 + local passing = false + if target ~= nil and actual ~= nil then + passing = actual <= target + end + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = passing, + message = 'value \'' .. tostring(actual) .. '\' not <= \'' .. + tostring(target) .. '\'', + test = label + }) + end, + + + -- @method - TestMethod:assertObject() + -- @desc - used to check a table is a love object, this runs 3 seperate + -- tests to check table has the basic properties of an object + -- @note - actual object functionality tests are done in the objects module + -- @param {table} obj - table to check is a valid love object + -- @return {nil} + assertObject = function(self, obj) + self:assertNotEquals(nil, obj, 'check not nill') + self:assertEquals('userdata', type(obj), 'check is userdata') + if obj ~= nil then + self:assertNotEquals(nil, obj:type(), 'check has :type()') + end + end, + + + + -- @method - TestMethod:skipTest() + -- @desc - used to mark this test as skipped for a specific reason + -- @param {string} reason - reason why method is being skipped + -- @return {nil} + skipTest = function(self, reason) + self.skipped = true + self.skipreason = reason + end, + + + -- @method - TestMethod:evaluateTest() + -- @desc - evaluates the results of all assertions for a final restult + -- @return {nil} + evaluateTest = function(self) + local failure = '' + local failures = 0 + for a=1,#self.asserts do + -- @TODO just return first failed assertion msg? or all? + -- currently just shows the first assert that failed + if self.asserts[a].passed == false and self.skipped == false then + if failure == '' then failure = self.asserts[a] end + failures = failures + 1 + end + end + if self.fatal ~= '' then failure = self.fatal end + local passed = tostring(#self.asserts - failures) + local total = '(' .. passed .. '/' .. tostring(#self.asserts) .. ')' + if self.skipped == true then + self.testmodule.skipped = self.testmodule.skipped + 1 + love.test.totals[3] = love.test.totals[3] + 1 + self.result = { + total = '', + result = "SKIP", + passed = false, + message = '(0/0) - method skipped [' .. self.skipreason .. ']' + } + else + if failure == '' and #self.asserts > 0 then + self.passed = true + self.testmodule.passed = self.testmodule.passed + 1 + love.test.totals[1] = love.test.totals[1] + 1 + self.result = { + total = total, + result = 'PASS', + passed = true, + message = nil + } + else + self.passed = false + self.testmodule.failed = self.testmodule.failed + 1 + love.test.totals[2] = love.test.totals[2] + 1 + if #self.asserts == 0 then + local msg = 'no asserts defined' + if self.fatal ~= '' then msg = self.fatal end + self.result = { + total = total, + result = 'FAIL', + passed = false, + key = 'test', + message = msg + } + else + local key = failure['key'] + if failure['test'] ~= nil then + key = key .. ' [' .. failure['test'] .. ']' + end + self.result = { + total = total, + result = 'FAIL', + passed = false, + key = key, + message = failure['message'] + } + end + end + end + self:printResult() + end, + + + -- @method - TestMethod:printResult() + -- @desc - prints the result of the test to the console as well as appends + -- the XML + HTML for the test to the testsuite output + -- @return {nil} + printResult = function(self) + + -- get total timestamp + -- @TODO make nicer, just need a 3DP ms value + self.finish = love.timer.getTime() - self.start + love.test.time = love.test.time + self.finish + self.testmodule.time = self.testmodule.time + self.finish + local endtime = tostring(math.floor((love.timer.getTime() - self.start)*1000)) + if string.len(endtime) == 1 then endtime = ' ' .. endtime end + if string.len(endtime) == 2 then endtime = ' ' .. endtime end + if string.len(endtime) == 3 then endtime = ' ' .. endtime end + + -- get failure/skip message for output (if any) + local failure = '' + local output = '' + if self.passed == false and self.skipped == false then + failure = '\t\t\t\n' + output = self.result.key .. ' ' .. self.result.message + end + if output == '' and self.skipped == true then + output = self.skipreason + end + + -- append XML for the test class result + self.testmodule.xml = self.testmodule.xml .. '\t\t\n' .. + failure .. '\t\t\n' + + -- unused currently, adds a preview image for certain graphics methods to the output + local preview = '' + -- if self.testmodule.module == 'graphics' then + -- local filename = 'love_test_graphics_rectangle' + -- preview = '
' .. '

Expected

' .. + -- '

Actual

' + -- end + + -- append HTML for the test class result + local status = '🔴' + local cls = 'red' + if self.passed == true then status = '🟢'; cls = '' end + if self.skipped == true then status = '🟡'; cls = '' end + self.testmodule.html = self.testmodule.html .. + '' .. + '' .. status .. '' .. + '' .. self.method .. '' .. + '' .. tostring(self.finish*1000) .. 'ms' .. + '' .. output .. preview .. '' .. + '' + + -- add message if assert failed + local msg = '' + if self.result.message ~= nil and self.skipped == false then + msg = ' - ' .. self.result.key .. + ' failed - (' .. self.result.message .. ')' + end + if self.skipped == true then + msg = self.result.message + end + + -- log final test result to console + -- i know its hacky but its neat soz + local tested = 'love.' .. self.testmodule.module .. '.' .. self.method .. '()' + local matching = string.sub(self.testmodule.spacer, string.len(tested), 40) + self.testmodule:log( + self.testmodule.colors[self.result.result], + ' ' .. tested .. matching, + ' ==> ' .. self.result.result .. ' - ' .. endtime .. 'ms ' .. + self.result.total .. msg + ) + end + + +} \ No newline at end of file diff --git a/testing/classes/TestModule.lua b/testing/classes/TestModule.lua new file mode 100644 index 000000000..379aac360 --- /dev/null +++ b/testing/classes/TestModule.lua @@ -0,0 +1,114 @@ +-- @class - TestModule +-- @desc - used to run tests for a given module, each test method will spawn +-- a love.test.Test object +TestModule = { + + + -- @method - TestModule:new() + -- @desc - create a new Suite object + -- @param {string} module - string of love module the suite is for + -- @return {table} - returns the new Suite object + new = function(self, module, method) + local testmodule = { + timer = 0, + time = 0, + delay = 0.1, + spacer = ' ', + colors = { + PASS = 'green', FAIL = 'red', SKIP = 'grey' + }, + colormap = { + grey = '\27[37m', + green = '\27[32m', + red = '\27[31m', + yellow = '\27[33m' + }, + xml = '', + html = '', + tests = {}, + running = {}, + called = {}, + passed = 0, + failed = 0, + skipped = 0, + module = module, + method = method, + index = 1, + start = false, + } + setmetatable(testmodule, self) + self.__index = self + return testmodule + end, + + + -- @method - TestModule:log() + -- @desc - log to console with specific colors, split out to make it easier + -- to adjust all console output across the tests + -- @param {string} color - color key to use for the log + -- @param {string} line - main message to write (LHS) + -- @param {string} result - result message to write (RHS) + -- @return {nil} + log = function(self, color, line, result) + if result == nil then result = '' end + print(self.colormap[color] .. line .. result) + end, + + + -- @method - TestModule:runTests() + -- @desc - starts the running of tests and sets up the list of methods to test + -- @param {string} module - module to set for the test suite + -- @param {string} method - specific method to test, if nil all methods tested + -- @return {nil} + runTests = function(self) + self.running = {} + self.passed = 0 + self.failed = 0 + if self.method ~= nil then + table.insert(self.running, self.method) + else + for i,_ in pairs(love.test[self.module]) do + table.insert(self.running, i) + end + table.sort(self.running) + end + self.index = 1 + self.start = true + self:log('yellow', '\nlove.' .. self.module .. '.testmodule.start') + end, + + + -- @method - TestModule:printResult() + -- @desc - prints the result of the module to the console as well as appends + -- the XML + HTML for the test to the testsuite output + -- @return {nil} + printResult = function(self) + -- add xml to main output + love.test.xml = love.test.xml .. '\t\n' .. self.xml .. '\t\n' + -- add html to main output + local status = '🔴' + if self.failed == 0 then status = '🟢' end + love.test.html = love.test.html .. '

' .. status .. ' love.' .. self.module .. '



' -- @TODO use mountFullPath to write output to src? - love.filesystem.createDirectory('output') - love.filesystem.write('output/' .. self.output .. '.xml', xml .. self.xml .. '') - love.filesystem.write('output/' .. self.output .. '.html', html .. self.html .. '') + love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite") + love.filesystem.remove('tempoutput/' .. self.output .. '.xml') + love.filesystem.remove('tempoutput/' .. self.output .. '.html') + love.filesystem.write('tempoutput/' .. self.output .. '.xml', xml .. self.xml .. '') + love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '') self.module:log('grey', '\nFINISHED - ' .. finaltime .. 's\n') local failedcol = '\27[31m' diff --git a/testing/output/readme.md b/testing/output/readme.md new file mode 100644 index 000000000..1a1059a7b --- /dev/null +++ b/testing/output/readme.md @@ -0,0 +1,2 @@ +# Testing Output +Any tests run will output an XML and HTML file here, assuming the tests are run with readwrite permissions for this repo \ No newline at end of file diff --git a/testing/readme.md b/testing/readme.md index 4269e4447..a156d2675 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -34,9 +34,9 @@ If you want to specify only 1 specific method only you can use: All results will be printed in the console per method as PASS, FAIL, or SKIP with total assertions met on a module level and overall level. -An `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format) will be generated in your save directory, along with a `HTML` file with a summary of all tests (including visuals for love.graphics tests). +An `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format) will be generated in the `/output` directory, along with a `HTML` file with a summary of all tests (including visuals for love.graphics tests) - you will need to make sure the command is run with read/write permissions for the source directory. > Note that this can only be viewed properly locally as the generated images are written to the save directory. -> An example of both types of output can be found in the `/output` folder +> An example of both types of output can be found in the `/examples` folder --- @@ -45,6 +45,7 @@ Each method has it's own test method written in `/tests` under the matching modu When you run the tests, a single TestSuite object is created which handles the progress + totals for all the tests. Each module has a TestModule object created, and each test method has a TestMethod object created which keeps track of assertions for that method. You can currently do the following assertions: +- **assertNotNil**(value) - **assertEquals**(expected, actual) - **assertNotEquals**(expected, actual) - **assertRange**(actual, min, max) @@ -60,14 +61,14 @@ Example test method: love.test.filesystem.read = function(test) -- setup any data needed then run any asserts using the passed test object local content, size = love.filesystem.read('resources/test.txt') - test:assertNotEquals(nil, content, 'check not nil') + test:assertNotNil(content) test:assertEquals('helloworld', content, 'check content match') test:assertEquals(10, size, 'check size match') content, size = love.filesystem.read('resources/test.txt', 5) - test:assertNotEquals(nil, content, 'check not nil') + test:assertNotNil(content) test:assertEquals('hello', content, 'check content match') test:assertEquals(5, size, 'check size match') - -- no need to return anything just cleanup any objs if needed + -- no need to return anything or cleanup, GCC is called after each method end ``` diff --git a/testing/todo.md b/testing/todo.md index 969cbf547..86fc2b105 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -2,25 +2,24 @@ # v0.2 -## Changed -- Added tests for all obj creation, transformation, window + system info graphics methods -- Added half the state methods for graphics + added placeholders for missing drawing methods -- Added TestMethod:assertNotNil() for quick nil checking -- Added time total to the end of each module summary in console log to match file output - -- Removed a bunch of unessecary nil checks -- Removed :release() from test methods, collectgarbage("collect") is called between methods instead - -- Renamed /output to /examples to avoid confusion - -- Replaced love.filesystem.newFile with love.filesystem.openFile -- Replaced love.math.noise with love.math.perlinNoise / love.math.simplexNoise - -- Fixed newGearJoint throwing an error in 12 as body needs to be dynamic not static now +## Todo +- finish graphics state methods +- start graphics drawing methods +- start object methods +- look into XML reader github actions to display results in readme? + dorny/test-reporter@v1.6.0 seems to do it + would need to run the tests first then could use it like: + + - name: Run Tests + - run: PATH_TO_BUILT_APP ./testing --runAllTests + - name: Test Report + uses: dorny/test-reporter@v1 + with: + name: Test Output + path: output/*.xml + reporter: jest-junit + + and d. check format: https://github.com/testmoapp/junitxml -- Some general cleanup, incl. better comments and time format in file output -## Todo -- graphics state methods -- graphics drawing methods - need a platform: format table somewhere for compressed formats (i.e. DXT not supported) From fae3b6ff633375a1e8e7ddb893433bee8a096f24 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 00:37:35 +0100 Subject: [PATCH 06/54] fix xml format --- .github/workflows/main.yml | 8 ++++++++ testing/classes/TestMethod.lua | 7 ++++--- testing/classes/TestSuite.lua | 2 -- testing/todo.md | 20 ++++++-------------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 787bf5b4a..70d7a9489 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -205,6 +205,14 @@ jobs: with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb + - name: Run All Tests + run: build/love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}.exe testing --runAllTests + - name: Test Report + uses: dorny/test-reporter@v1 + with: + name: Test Output + path: testing/output/*.xml + reporter: jest-junit macOS: runs-on: macos-latest steps: diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 8fa55080f..0294756e3 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -309,14 +309,15 @@ TestMethod = { output = self.result.key .. ' ' .. self.result.message end if output == '' and self.skipped == true then + failure = '\t\t\t\n' .. - failure .. '\t\t\n' + failure .. '\t\t\n' -- unused currently, adds a preview image for certain graphics methods to the output local preview = '' diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 012947771..99ee6bbcc 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -145,8 +145,6 @@ TestSuite = { -- @TODO use mountFullPath to write output to src? love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite") - love.filesystem.remove('tempoutput/' .. self.output .. '.xml') - love.filesystem.remove('tempoutput/' .. self.output .. '.html') love.filesystem.write('tempoutput/' .. self.output .. '.xml', xml .. self.xml .. '') love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '') diff --git a/testing/todo.md b/testing/todo.md index 86fc2b105..1a9e28a8d 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -6,20 +6,12 @@ - finish graphics state methods - start graphics drawing methods - start object methods -- look into XML reader github actions to display results in readme? - dorny/test-reporter@v1.6.0 seems to do it - would need to run the tests first then could use it like: - - - name: Run Tests - - run: PATH_TO_BUILT_APP ./testing --runAllTests - - name: Test Report - uses: dorny/test-reporter@v1 - with: - name: Test Output - path: output/*.xml - reporter: jest-junit - - and d. check format: https://github.com/testmoapp/junitxml +- some joystick/input stuff could be at least nil checked maybe? +- add test run for linux, windows, + ios builds +- pass in err string returns to the test output + maybe even assertNotNil could use the second value automatically + test:assertNotNil(love.filesystem.openFile('file2', 'r')) wouldn't have to change - need a platform: format table somewhere for compressed formats (i.e. DXT not supported) + could add platform as global to command and then use in tests? From 6c29497be2a0b3bb705f089ceeb607148fe824ab Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 00:53:29 +0100 Subject: [PATCH 07/54] skipped format --- testing/classes/TestMethod.lua | 2 +- testing/todo.md | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 0294756e3..7ef97ec81 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -309,7 +309,7 @@ TestMethod = { output = self.result.key .. ' ' .. self.result.message end if output == '' and self.skipped == true then - failure = '\t\t\t\n' output = self.skipreason end diff --git a/testing/todo.md b/testing/todo.md index 1a9e28a8d..e64f5e165 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -1,17 +1,15 @@ `/Applications/love_12.app/Contents/MacOS/love ./testing` -# v0.2 - ## Todo +- fix XML format +- check test runs for windows setup +- add runs for linux + ios - finish graphics state methods - start graphics drawing methods - start object methods - some joystick/input stuff could be at least nil checked maybe? -- add test run for linux, windows, + ios builds - pass in err string returns to the test output maybe even assertNotNil could use the second value automatically test:assertNotNil(love.filesystem.openFile('file2', 'r')) wouldn't have to change - - - need a platform: format table somewhere for compressed formats (i.e. DXT not supported) - could add platform as global to command and then use in tests? + could add platform as global to command and then use in tests? \ No newline at end of file From a513320a4741b2c4b140f9d983a7a43b5b8c714a Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:10:08 +0100 Subject: [PATCH 08/54] prevent empty tag dorny/test-reporter@v1 will fail to parse tags that are empty as it's expected a message both in the attr and inside --- .github/workflows/main.yml | 2 +- testing/classes/TestMethod.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 70d7a9489..4f7aa5628 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -206,7 +206,7 @@ jobs: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb - name: Run All Tests - run: build/love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}.exe testing --runAllTests + run: "build/love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}.exe" "testing" --console --runAllTests - name: Test Report uses: dorny/test-reporter@v1 with: diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 7ef97ec81..7422fb935 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -303,13 +303,15 @@ TestMethod = { -- get failure/skip message for output (if any) local failure = '' local output = '' + -- @NOTE if you don't put anything inside of the then + -- dorny/test-reporter@v1 will fail to parse it if self.passed == false and self.skipped == false then failure = '\t\t\t\n' + self.result.message .. '">' .. self.result.key .. ' ' .. self.result.message .. '\n' output = self.result.key .. ' ' .. self.result.message end if output == '' and self.skipped == true then - failure = '\t\t\t\n' + failure = '\t\t\t\n' output = self.skipreason end From ac5f97e656a3e8a0669dfedda4447ccc70804fa0 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:14:44 +0100 Subject: [PATCH 09/54] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f7aa5628..6eac9e3d8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -206,7 +206,7 @@ jobs: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb - name: Run All Tests - run: "build/love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}.exe" "testing" --console --runAllTests + run: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}.exe testing --console --runAllTests - name: Test Report uses: dorny/test-reporter@v1 with: From 04293d3fbd1c5712ee23cc47e165b060f53622c2 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:26:51 +0100 Subject: [PATCH 10/54] use love-test-report action added md support to work with love-test-report, a basic action made to just dump md files into repo checks --- .github/workflows/main.yml | 24 +++++++++++++----------- .gitignore | 1 + testing/classes/TestMethod.lua | 6 ++++-- testing/classes/TestModule.lua | 11 +++++++++-- testing/classes/TestSuite.lua | 18 +++++++++++++++++- testing/output/readme.md | 2 +- testing/todo.md | 3 +-- 7 files changed, 46 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6eac9e3d8..31c982836 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -205,14 +205,16 @@ jobs: with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb + - name: Build Test Exe + run: cmake --build build --config Release --target install - name: Run All Tests - run: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}.exe testing --console --runAllTests - - name: Test Report - uses: dorny/test-reporter@v1 + run: install\love.exe testing --console --runAllTests + - name: Love Test Report + uses: ellraiser/love-test-report@main with: - name: Test Output - path: testing/output/*.xml - reporter: jest-junit + name: Love Testsuite Windows + title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report + path: testing/output/lovetest_runAllTests.md macOS: runs-on: macos-latest steps: @@ -243,12 +245,12 @@ jobs: path: love-macos.zip - name: Run All Tests run: love-macos/love.app/Contents/MacOS/love testing --runAllTests - - name: Test Report - uses: dorny/test-reporter@v1 + - name: Love Test Report + uses: ellraiser/love-test-report@main with: - name: Test Output - path: testing/output/*.xml - reporter: jest-junit + name: Love Testsuite MacOS + title: macos-test-report + path: testing/output/lovetest_runAllTests.md iOS-Simulator: runs-on: macos-latest steps: diff --git a/.gitignore b/.gitignore index 5bc5b9401..f84038cd7 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ stamp-h1 .vscode/ /testing/output/*.xml /testing/output/*.html +/testing/output/*.md diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 7422fb935..6f9b182f9 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -303,18 +303,20 @@ TestMethod = { -- get failure/skip message for output (if any) local failure = '' local output = '' - -- @NOTE if you don't put anything inside of the then - -- dorny/test-reporter@v1 will fail to parse it if self.passed == false and self.skipped == false then failure = '\t\t\t' .. self.result.key .. ' ' .. self.result.message .. '\n' output = self.result.key .. ' ' .. self.result.message + -- append failures if any to report md + love.test.mdfailures = love.test.mdfailures .. '> 🔴 ' .. self.method .. ' \n' .. + '> ' .. output .. ' \n\n' end if output == '' and self.skipped == true then failure = '\t\t\t\n' output = self.skipreason end + -- append XML for the test class result self.testmodule.xml = self.testmodule.xml .. '\t\t\n' .. self.xml .. '\t\n' -- add html to main output - local status = '🔴' - if self.failed == 0 then status = '🟢' end love.test.html = love.test.html .. '

' .. status .. ' love.' .. self.module .. '

    ' .. '
  • 🟢 ' .. tostring(self.passed) .. ' Tests
  • ' .. '
  • 🔴 ' .. tostring(self.failed) .. ' Failures
  • ' .. diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 99ee6bbcc..0396d841b 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -17,6 +17,8 @@ TestSuite = { time = 0, xml = '', html = '', + mdrows = '', + mdfailures = '', fakequit = false, windowmode = true, @@ -124,10 +126,23 @@ TestSuite = { -- @method - TestSuite:printResult() -- @desc - prints the result of the whole test suite as well as writes - -- the XML + HTML of the testsuite output + -- the MD, XML + HTML of the testsuite output -- @return {nil} printResult = function(self) local finaltime = UtilTimeFormat(self.time) + + local md = '\n\n' .. + '**' .. tostring(self.totals[1] + self.totals[2] + self.totals[3]) .. '** tests were completed in **' .. + finaltime .. 's** with **' .. + tostring(self.totals[1]) .. '** passed, **' .. + tostring(self.totals[2]) .. '** failed, and **' .. + tostring(self.totals[3]) .. '** skipped\n\n### Report\n' .. + '| Module | Passed | Failed | Skipped | Time |\n' .. + '| --------------------- | ------ | ------ | ------- | ------ |\n' .. + self.mdrows .. '\n\n### Failures\n' .. self.mdfailures local xml = '') love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '') + love.filesystem.write('tempoutput/' .. self.output .. '.md', md) self.module:log('grey', '\nFINISHED - ' .. finaltime .. 's\n') local failedcol = '\27[31m' diff --git a/testing/output/readme.md b/testing/output/readme.md index 1a1059a7b..bff4c6375 100644 --- a/testing/output/readme.md +++ b/testing/output/readme.md @@ -1,2 +1,2 @@ # Testing Output -Any tests run will output an XML and HTML file here, assuming the tests are run with readwrite permissions for this repo \ No newline at end of file +Any tests run will output an XML, MD, and HTML file here, assuming the tests are run with readwrite permissions for this repo \ No newline at end of file diff --git a/testing/todo.md b/testing/todo.md index e64f5e165..f5951c748 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -1,9 +1,8 @@ `/Applications/love_12.app/Contents/MacOS/love ./testing` ## Todo -- fix XML format - check test runs for windows setup -- add runs for linux + ios +- add runs for linux + ios? - finish graphics state methods - start graphics drawing methods - start object methods From 6a0ff067c8a6f8c2a4f51a49d7c5a493959b1b24 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:39:43 +0100 Subject: [PATCH 11/54] fixed test.filesystem.openFile --- .github/workflows/main.yml | 6 +++--- testing/tests/filesystem.lua | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 31c982836..c5ae7da5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -206,9 +206,9 @@ jobs: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb - name: Build Test Exe - run: cmake --build build --config Release --target install + run: cmake --build build --config Release --target testbuild - name: Run All Tests - run: install\love.exe testing --console --runAllTests + run: testbuild\love.exe ./testing/main.lua --console - name: Love Test Report uses: ellraiser/love-test-report@main with: @@ -244,7 +244,7 @@ jobs: name: love-macos path: love-macos.zip - name: Run All Tests - run: love-macos/love.app/Contents/MacOS/love testing --runAllTests + run: love-macos/love.app/Contents/MacOS/love testing - name: Love Test Report uses: ellraiser/love-test-report@main with: diff --git a/testing/tests/filesystem.lua b/testing/tests/filesystem.lua index a360dc6d8..248aa39c4 100644 --- a/testing/tests/filesystem.lua +++ b/testing/tests/filesystem.lua @@ -231,10 +231,11 @@ end -- love.filesystem.openFile -- @NOTE this is just basic nil checking, full obj test are in objects.lua love.test.filesystem.openFile = function(test) - test:assertNotNil(love.filesystem.openFile('file2', 'r')) - test:assertNotNil(love.filesystem.openFile('file2', 'w')) - test:assertNotNil(love.filesystem.openFile('file2', 'a')) - test:assertNotNil(love.filesystem.openFile('file2', 'c')) + test:assertNotNil(love.filesystem.openFile('file2.txt', 'w')) + test:assertNotNil(love.filesystem.openFile('file2.txt', 'r')) + test:assertNotNil(love.filesystem.openFile('file2.txt', 'a')) + test:assertNotNil(love.filesystem.openFile('file2.txt', 'c')) + love.filesystem.remove('file2.txt') end From 5ac5438cb4dc746f653c319f58ab5c22d4248d3d Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:02:12 +0100 Subject: [PATCH 12/54] try lovec instead --- .github/workflows/main.yml | 4 ++-- testing/todo.md | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5ae7da5b..c8a990cb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -206,9 +206,9 @@ jobs: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb - name: Build Test Exe - run: cmake --build build --config Release --target testbuild + run: cmake --build build --config Release --target install - name: Run All Tests - run: testbuild\love.exe ./testing/main.lua --console + run: install\lovec.exe ./testing/main.lua - name: Love Test Report uses: ellraiser/love-test-report@main with: diff --git a/testing/todo.md b/testing/todo.md index f5951c748..78ca67640 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -1,14 +1,19 @@ `/Applications/love_12.app/Contents/MacOS/love ./testing` -## Todo -- check test runs for windows setup -- add runs for linux + ios? -- finish graphics state methods -- start graphics drawing methods -- start object methods -- some joystick/input stuff could be at least nil checked maybe? -- pass in err string returns to the test output +## CI +- [ ] ignore test suite for windows AMD +- [ ] add test run to linux + ios builds +- [ ] add metal/vulkan runs + +## TESTSUITE +- [ ] finish graphics state methods +- [ ] start graphics drawing methods +- [ ] start object methods + +## FUTURE +- [ ] pass in err string returns to the test output maybe even assertNotNil could use the second value automatically test:assertNotNil(love.filesystem.openFile('file2', 'r')) wouldn't have to change -- need a platform: format table somewhere for compressed formats (i.e. DXT not supported) +- [ ] some joystick/input stuff could be at least nil checked maybe? +- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) could add platform as global to command and then use in tests? \ No newline at end of file From a620910121816f1e969fe56adc77110ac996f0b0 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:33:53 +0100 Subject: [PATCH 13/54] add renderer alts. --- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++---------- testing/todo.md | 3 +-- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8a990cb2..baa2e7286 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -206,14 +206,27 @@ jobs: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb - name: Build Test Exe + if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - - name: Run All Tests - run: install\lovec.exe ./testing/main.lua - - name: Love Test Report + - name: Run All Tests (OpenGL) + if: steps.vars.outputs.arch != 'ARM64' + run: install\lovec.exe testing/main.lua --renderers opengl + - name: Love Test Report (OpenGL) + if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: - name: Love Testsuite Windows - title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report + name: Love Testsuite Windows (OpenGL) + title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report-opengl + path: testing/output/lovetest_runAllTests.md + - name: Run All Tests (Vulkan) + if: steps.vars.outputs.arch != 'ARM64' + run: install\lovec.exe testing/main.lua --renderers vulkan + - name: Love Test Report (Vulkan) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (Vulkan) + title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report-vulkan path: testing/output/lovetest_runAllTests.md macOS: runs-on: macos-latest @@ -243,13 +256,21 @@ jobs: with: name: love-macos path: love-macos.zip - - name: Run All Tests - run: love-macos/love.app/Contents/MacOS/love testing - - name: Love Test Report + - name: Run All Tests (OpenGL) + run: love-macos/love.app/Contents/MacOS/love testing --renderers opengl + - name: Love Test Report (OpenGL) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite MacOS (OpenGL) + title: macos-test-report-opengl + path: testing/output/lovetest_runAllTests.md + - name: Run All Tests (metal) + run: love-macos/love.app/Contents/MacOS/love testing --renderers opengl + - name: Love Test Report (metal) uses: ellraiser/love-test-report@main with: - name: Love Testsuite MacOS - title: macos-test-report + name: Love Testsuite MacOS (Metal) + title: macos-test-report-metal path: testing/output/lovetest_runAllTests.md iOS-Simulator: runs-on: macos-latest diff --git a/testing/todo.md b/testing/todo.md index 78ca67640..480c19e7a 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -2,8 +2,7 @@ ## CI - [ ] ignore test suite for windows AMD -- [ ] add test run to linux + ios builds -- [ ] add metal/vulkan runs +- [ ] add test run to linux (opengl+vulkan) + ios builds (opengl+metal) ## TESTSUITE - [ ] finish graphics state methods From 8f10ba907c8da6a00bf51f660950ca73e7b4add1 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:58:55 +0100 Subject: [PATCH 14/54] check flag change --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index baa2e7286..f8ef7a5dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -210,7 +210,7 @@ jobs: run: cmake --build build --config Release --target install - name: Run All Tests (OpenGL) if: steps.vars.outputs.arch != 'ARM64' - run: install\lovec.exe testing/main.lua --renderers opengl + run: install\lovec.exe testing/main.lua - name: Love Test Report (OpenGL) if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main @@ -257,7 +257,7 @@ jobs: name: love-macos path: love-macos.zip - name: Run All Tests (OpenGL) - run: love-macos/love.app/Contents/MacOS/love testing --renderers opengl + run: love-macos/love.app/Contents/MacOS/love testing - name: Love Test Report (OpenGL) uses: ellraiser/love-test-report@main with: @@ -265,7 +265,7 @@ jobs: title: macos-test-report-opengl path: testing/output/lovetest_runAllTests.md - name: Run All Tests (metal) - run: love-macos/love.app/Contents/MacOS/love testing --renderers opengl + run: love-macos/love.app/Contents/MacOS/love testing --renderers metal - name: Love Test Report (metal) uses: ellraiser/love-test-report@main with: From e1948f6e57376a3566fe4de0564b1ffc3d154886 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:12:07 +0100 Subject: [PATCH 15/54] added all graphics 'state' tests --- .github/workflows/main.yml | 51 +++--- testing/classes/TestMethod.lua | 37 +++- testing/classes/TestSuite.lua | 51 ++++-- testing/conf.lua | 4 +- testing/main.lua | 44 +++-- testing/readme.md | 51 +++--- testing/tests/graphics.lua | 321 ++++++++++++++++++++++++++++++--- testing/tests/system.lua | 4 +- testing/tests/window.lua | 58 +++--- testing/todo.md | 36 +++- 10 files changed, 506 insertions(+), 151 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8ef7a5dd..9fb1f58bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,6 +49,16 @@ jobs: with: name: love-x86_64-AppImage-debug path: love-${{ github.sha }}.AppImage-debug.tar.gz + - name: Make Runnable + run: chmod a+x love-linux-x86_64.AppImage + - name: Run All Tests + run: xvfb-run love-linux-x86_64.AppImage testing + - name: Love Test Report + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: linux-test-report + path: testing/output/lovetest_runAllTests.md windows-os: runs-on: windows-latest strategy: @@ -208,25 +218,22 @@ jobs: - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - - name: Run All Tests (OpenGL) + - name: Install Mesa if: steps.vars.outputs.arch != 'ARM64' - run: install\lovec.exe testing/main.lua - - name: Love Test Report (OpenGL) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (OpenGL) - title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report-opengl - path: testing/output/lovetest_runAllTests.md - - name: Run All Tests (Vulkan) + run: | + curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z + 7z x mesa.7z + mklink opengl32.dll "x64\opengl32.dll" + mklink libglapi.dll "x64\libglapi.dll" + - name: Run All Tests if: steps.vars.outputs.arch != 'ARM64' - run: install\lovec.exe testing/main.lua --renderers vulkan - - name: Love Test Report (Vulkan) + run: install\lovec.exe testing/main.lua + - name: Love Test Report if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: - name: Love Testsuite Windows (Vulkan) - title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report-vulkan + name: Love Testsuite Windows + title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report path: testing/output/lovetest_runAllTests.md macOS: runs-on: macos-latest @@ -256,21 +263,13 @@ jobs: with: name: love-macos path: love-macos.zip - - name: Run All Tests (OpenGL) + - name: Run All Tests run: love-macos/love.app/Contents/MacOS/love testing - - name: Love Test Report (OpenGL) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite MacOS (OpenGL) - title: macos-test-report-opengl - path: testing/output/lovetest_runAllTests.md - - name: Run All Tests (metal) - run: love-macos/love.app/Contents/MacOS/love testing --renderers metal - - name: Love Test Report (metal) + - name: Love Test Report uses: ellraiser/love-test-report@main with: - name: Love Testsuite MacOS (Metal) - title: macos-test-report-metal + name: Love Testsuite MacOS + title: macos-test-report path: testing/output/lovetest_runAllTests.md iOS-Simulator: runs-on: macos-latest diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 6f9b182f9..9b355a6bb 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -25,11 +25,19 @@ TestMethod = { result = {}, colors = { red = {1, 0, 0, 1}, + redpale = {1, 0.5, 0.5, 1}, + red07 = {0.7, 0, 0, 1}, green = {0, 1, 0, 1}, + greenhalf = {0, 0.5, 0, 1}, + greenfade = {0, 1, 0, 0.5}, blue = {0, 0, 1, 1}, + bluefade = {0, 0, 1, 0.5}, + yellow = {1, 1, 0, 1}, black = {0, 0, 0, 1}, white = {1, 1, 1, 1} - } + }, + delay = 0, + delayed = false } setmetatable(test, self) self.__index = self @@ -69,6 +77,11 @@ TestMethod = { local coord = pixels[p] local tr, tg, tb, ta = imgdata:getPixel(coord[1], coord[2]) local compare_id = tostring(coord[1]) .. ',' .. tostring(coord[2]) + -- prevent us getting stuff like 0.501960785 for 0.5 red + tr = math.floor((tr*10)+0.5)/10 + tg = math.floor((tg*10)+0.5)/10 + tb = math.floor((tb*10)+0.5)/10 + ta = math.floor((ta*10)+0.5)/10 -- @TODO add some sort pixel tolerance to the coords self:assertEquals(col[1], tr, 'check pixel r for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') self:assertEquals(col[2], tg, 'check pixel g for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') @@ -201,12 +214,19 @@ TestMethod = { -- @desc - quick assert for value not nil -- @param {any} value - value to check not nil -- @return {nil} - assertNotNil = function (self, value) + assertNotNil = function (self, value, err) self:assertNotEquals(nil, value, 'check not nil') + if err ~= nil then + table.insert(self.asserts, { + key = 'assert #' .. tostring(self.count), + passed = false, + message = err, + test = 'assert not nil catch' + }) + end end, - -- @method - TestMethod:skipTest() -- @desc - used to mark this test as skipped for a specific reason -- @param {string} reason - reason why method is being skipped @@ -217,6 +237,17 @@ TestMethod = { end, + -- currently unused + setDelay = function(self, frames) + self.delay = frames + self.delayed = true + love.test.delayed = self + end, + isDelayed = function(self) + return self.delayed + end, + + -- @method - TestMethod:evaluateTest() -- @desc - evaluates the results of all assertions for a final restult -- @return {nil} diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 0396d841b..92094ae88 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -10,6 +10,7 @@ TestSuite = { -- testsuite internals modules = {}, module = nil, + test = nil, testcanvas = nil, current = 1, output = '', @@ -19,6 +20,7 @@ TestSuite = { html = '', mdrows = '', mdfailures = '', + delayed = nil, fakequit = false, windowmode = true, @@ -70,7 +72,8 @@ TestSuite = { if self.module.called[self.module.index] == nil then self.module.called[self.module.index] = true local method = self.module.running[self.module.index] - local test = TestMethod:new(method, self.module) + self.test = TestMethod:new(method, self.module) + TextRun:set('love.' .. self.module.module .. '.' .. method) -- check method exists in love first if self.module.module ~= 'objects' and (love[self.module.module] == nil or love[self.module.module][method] == nil) then @@ -80,26 +83,52 @@ TestSuite = { tested .. matching, ' ==> FAIL (0/0) - call failed - method does not exist' ) - -- otherwise run the test method then eval the asserts + -- otherwise run the test method else - local ok, chunk, err = pcall(self[self.module.module][method], test) + local ok, chunk, err = pcall(self[self.module.module][method], self.test) if ok == false then print("FATAL", chunk, err) - test.fatal = tostring(chunk) .. tostring(err) + self.test.fatal = tostring(chunk) .. tostring(err) end - local ok, chunk, err = pcall(test.evaluateTest, test) + end + + -- once we've run check delay + eval + else + + -- @TODO use coroutines? + -- if we have a test method that needs a delay + -- we wait for the delay to run out first + if self.delayed ~= nil then + self.delayed.delay = self.delayed.delay - 1 + -- re-run the test method again when delay ends + -- its up to the test to handle the :isDelayed() property + if self.delayed.delay <= 0 then + local ok, chunk, err = pcall(self[self.module.module][self.delayed.method], self.test) + if ok == false then + print("FATAL", chunk, err) + self.test.fatal = tostring(chunk) .. tostring(err) + end + self.delayed = nil + end + else + + -- now we're all done evaluate the test + local ok, chunk, err = pcall(self.test.evaluateTest, self.test) if ok == false then print("FATAL", chunk, err) - test.fatal = tostring(chunk) .. tostring(err) + self.test.fatal = tostring(chunk) .. tostring(err) end + -- save having to :release() anything we made in the last test + -- 7251ms > 7543ms + collectgarbage("collect") + -- move onto the next test + self.module.index = self.module.index + 1 + end - -- save having to :release() anything we made in the last test - -- 7251ms > 7543ms - collectgarbage("collect") - -- move onto the next test - self.module.index = self.module.index + 1 + end + -- once all tests have run else -- print module results and add to output diff --git a/testing/conf.lua b/testing/conf.lua index f04c2d90a..a5c0de279 100644 --- a/testing/conf.lua +++ b/testing/conf.lua @@ -1,8 +1,8 @@ function love.conf(t) t.console = true t.window.name = 'love.test' - t.window.width = 256 - t.window.height = 256 + t.window.width = 360 + t.window.height = 240 t.window.resizable = true t.renderers = {"opengl"} t.modules.audio = true diff --git a/testing/main.lua b/testing/main.lua index c90040818..292ad82c6 100644 --- a/testing/main.lua +++ b/testing/main.lua @@ -33,7 +33,7 @@ love.load = function(args) -- setup basic img to display if love.window ~= nil then - love.window.setMode(256, 256, { + love.window.setMode(360, 240, { fullscreen = false, resizable = true, centered = true @@ -47,6 +47,9 @@ love.load = function(args) img = nil } Logo.img = love.graphics.newQuad(0, 0, 64, 64, Logo.texture) + Font = love.graphics.newFont('resources/font.ttf', 8, 'normal') + TextCommand = love.graphics.newTextBatch(Font, 'Loading...') + TextRun = love.graphics.newTextBatch(Font, '') end end @@ -63,6 +66,7 @@ love.load = function(args) local testcmd = '--runAllTests' local module = '' local method = '' + local cmderr = 'Invalid flag used' local modules = { 'audio', 'data', 'event', 'filesystem', 'font', 'graphics', 'image', 'math', 'objects', 'physics', 'sound', 'system', @@ -97,9 +101,14 @@ love.load = function(args) if testcmd == '--runSpecificMethod' then local testmodule = TestModule:new(module, method) table.insert(love.test.modules, testmodule) - love.test.module = testmodule - love.test.module:log('grey', '--runSpecificMethod "' .. module .. '" "' .. method .. '"') - love.test.output = 'lovetest_runSpecificMethod_' .. module .. '_' .. method + if module ~= '' and method ~= '' then + love.test.module = testmodule + love.test.module:log('grey', '--runSpecificMethod "' .. module .. '" "' .. method .. '"') + love.test.output = 'lovetest_runSpecificMethod_' .. module .. '_' .. method + else + if method == '' then cmderr = 'No valid method specified' end + if module == '' then cmderr = 'No valid module specified' end + end end -- runSpecificModules runs all methods for all the modules given @@ -110,10 +119,13 @@ love.load = function(args) table.insert(love.test.modules, testmodule) table.insert(modulelist, modules[m]) end - - love.test.module = love.test.modules[1] - love.test.module:log('grey', '--runSpecificModules "' .. table.concat(modulelist, '" "') .. '"') - love.test.output = 'lovetest_runSpecificModules_' .. table.concat(modulelist, '_') + if #modulelist > 0 then + love.test.module = love.test.modules[1] + love.test.module:log('grey', '--runSpecificModules "' .. table.concat(modulelist, '" "') .. '"') + love.test.output = 'lovetest_runSpecificModules_' .. table.concat(modulelist, '_') + else + cmderr = 'No modules specified' + end end -- otherwise default runs all methods for all modules @@ -129,12 +141,14 @@ love.load = function(args) -- invalid command if love.test.module == nil then - print("Wrong flags used") + print(cmderr) + love.event.quit(0) + else + -- start first module + TextCommand:set(testcmd) + love.test.module:runTests() end - -- start first module - love.test.module:runTests() - end -- love.update @@ -147,7 +161,11 @@ end -- love.draw -- draw a little logo to the screen love.draw = function() - love.graphics.draw(Logo.texture, Logo.img, 64, 64, 0, 2, 2) + local lw = (love.graphics.getPixelWidth() - 128) / 2 + local lh = (love.graphics.getPixelHeight() - 128) / 2 + love.graphics.draw(Logo.texture, Logo.img, lw, lh, 0, 2, 2) + love.graphics.draw(TextCommand, 4, 12, 0, 2, 2) + love.graphics.draw(TextRun, 4, 32, 0, 2, 2) end diff --git a/testing/readme.md b/testing/readme.md index a156d2675..32842061b 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -12,6 +12,7 @@ Currently written for löve 12 - [x] No platform-specific dependencies / scripts - [x] Ability to run a subset of tests - [x] Ability to easily run an individual test. +- [x] Automatic testing that happens after every commit --- @@ -81,27 +82,25 @@ For sanity-checking, if it's currently not covered or we're not sure how to test ## Coverage This is the status of all module tests currently. "objects" is a special module to cover any object specific tests, i.e. testing a File object functions as expected -```lua --- [x] audio 26 PASSED | 0 FAILED | 0 SKIPPED --- [x] data 7 PASSED | 0 FAILED | 3 SKIPPED [SEE BELOW] --- [x] event 4 PASSED | 0 FAILED | 2 SKIPPED [SEE BELOW] --- [x] filesystem 27 PASSED | 0 FAILED | 2 SKIPPED --- [x] font 4 PASSED | 0 FAILED | 1 SKIPPED [SEE BELOW] --- [ ] graphics 65 PASSED | 0 FAILED | 31 SKIPPED [SEE BELOW] --- [x] image 3 PASSED | 0 FAILED | 0 SKIPPED --- [x] math 17 PASSED | 0 FAILED | 0 SKIPPED --- [x] physics 22 PASSED | 0 FAILED | 0 SKIPPED --- [x] sound 2 PASSED | 0 FAILED | 0 SKIPPED --- [x] system 6 PASSED | 0 FAILED | 2 SKIPPED --- [x] thread 3 PASSED | 0 FAILED | 0 SKIPPED --- [x] timer 6 PASSED | 0 FAILED | 0 SKIPPED --- [x] video 1 PASSED | 0 FAILED | 0 SKIPPED --- [x] window 32 PASSED | 2 FAILED | 2 SKIPPED [SEE BELOW] - --- [ ] objects STILL TO BE DONE --------------------------------------------------------------------------------- --- [x] totals 226 PASSED | 4 FAILED | 43 SKIPPED -``` +| Module | Passed | Failed | Skipped | Time | +| --------------------- | ------ | ------ | ------- | ------ | +| 🟢 love.audio | 26 | 0 | 0 | 2.602s | +| 🟢 love.data | 7 | 0 | 3 | 1.003s | +| 🟢 love.event | 4 | 0 | 2 | 0.599s | +| 🟢 love.filesystem | 27 | 0 | 2 | 2.900s | +| 🟢 love.font | 4 | 0 | 1 | 0.500s | +| 🟢 love.graphics | 81 | 0 | 15 | 10.678s | +| 🟢 love.image | 3 | 0 | 0 | 0.300s | +| 🟢 love.math | 17 | 0 | 0 | 1.678s | +| 🟢 love.objects | 1 | 0 | 0 | 0.121s | +| 🟢 love.physics | 22 | 0 | 0 | 2.197s | +| 🟢 love.sound | 2 | 0 | 0 | 0.200s | +| 🟢 love.system | 6 | 0 | 2 | 0.802s | +| 🟢 love.thread | 3 | 0 | 0 | 0.300s | +| 🟢 love.timer | 6 | 0 | 0 | 2.358s | +| 🟢 love.video | 1 | 0 | 0 | 0.100s | +| 🟢 love.window | 34 | 0 | 2 | 8.050s | +**271** tests were completed in **34.387s** with **244** passed, **0** failed, and **27** skipped The following modules are not covered as we can't really emulate input nicely: `joystick`, `keyboard`, `mouse`, and `touch` @@ -113,23 +112,17 @@ Modules with some small bits needed or needing sense checking: - **love.data** - packing methods need writing cos i dont really get what they are - **love.event** - love.event.wait or love.event.pump need writing if possible I dunno how to check - **love.font** - newBMFontRasterizer() wiki entry is wrong so not sure whats expected -- **love.graphics** - still need to do tests for the drawing and state methods +- **love.graphics** - still need to do tests for the main drawing methods - **love.image** - ideally isCompressed should have an example of all compressed files love can take - **love.math** - linearToGamma + gammaToLinear using direct formulas don't get same value back - **love.objects** - not started properly yet - ---- - -## Failures -- **love.window.isMaximized()** - returns false after calling love.window.maximize? -- **love.window.maximize()** - same as above +- **love.graphics.setStencilTest** - deprecated, replaced by setStencilMode() --- ## Stretch Goals - [ ] Tests can compare visual results to a reference image - [ ] Ability to see all visual results at a glance -- [ ] Automatic testing that happens after every commit - [ ] Ability to test loading different combinations of modules - [ ] Performance tests diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index 2b8726e5e..5e054d1f3 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -112,11 +112,10 @@ love.test.graphics.rectangle = function(test) love.graphics.setCanvas() local imgdata1 = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) -- test, check red bg and blue central square - local comparepixels = { + test:assertPixels(imgdata1, { red = {{0,0},{15,0},{15,15},{0,15}}, blue = {{6,6},{9,6},{9,9},{6,9}} - } - test:assertPixels(imgdata1, comparepixels, 'fill') + }, 'fill') -- clear canvas to do some line testing love.graphics.setCanvas(canvas) love.graphics.clear(0, 0, 0, 1) @@ -126,16 +125,19 @@ love.test.graphics.rectangle = function(test) love.graphics.rectangle('line', 1, 1, 2, 15) -- 3x16 left aligned blue outline love.graphics.setColor(0, 1, 0, 1) love.graphics.rectangle('line', 11, 1, 5, 15) -- 6x16 right aligned green outline + love.graphics.setColor(1, 1, 1, 1) love.graphics.setCanvas() local imgdata2 = love.graphics.readbackTexture(canvas, {1, 1, 0, 0, 16, 16}) -- -- check corners and inner corners - comparepixels = { + test:assertPixels(imgdata2, { red = {{3,0},{9,0},{3,15,9,15}}, blue = {{0,0},{2,0},{0,15},{2,15}}, green = {{10,0},{15,0},{10,15},{15,15}}, - black = {{1,1},{1,14},{3,1},{9,1},{3,14},{9,14},{11,1},{14,1},{11,14},{14,14}} - } - test:assertPixels(imgdata2, comparepixels, 'line') + black = { + {1,1},{1,14},{3,1},{9,1},{3,14}, + {9,14},{11,1},{14,1},{11,14},{14,14} + } + }, 'line') end @@ -147,10 +149,15 @@ end -- love.graphics.captureScreenshot --- @NOTE could test this but not with current setup as we need to wait for the --- draw frame to finish before we could assert the file was created love.test.graphics.captureScreenshot = function(test) - test:skipTest('cant test this worked (easily)') + if test:isDelayed() == false then + love.graphics.captureScreenshot('example-screenshot.png') + test:setDelay(10) + -- need to wait until end of the frame for the screenshot + else + test:assertNotNil(love.filesystem.openFile('example-screenshot.png', 'r')) + love.filesystem.remove('example-screenshot.png') + end end @@ -611,34 +618,117 @@ love.test.graphics.setBackgroundColor = function(test) test:assertEquals(0, g, 'check set bg g') test:assertEquals(0, b, 'check set bg b') test:assertEquals(1, a, 'check set bg a') + love.graphics.setBackgroundColor(0, 0, 0, 1) end -- love.graphics.setBlendMode love.test.graphics.setBlendMode = function(test) - -- set mode, write to canvas, check output - test:skipTest('test method needs writing') + -- create fully white canvas, then draw diff. pixels through blendmodes + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0.5, 0.5, 0.5, 1) + love.graphics.setBlendMode('add', 'alphamultiply') + love.graphics.setColor(1, 0, 0, 1) + love.graphics.points({1,1}) + love.graphics.setBlendMode('subtract', 'alphamultiply') + love.graphics.setColor(1, 1, 1, 0.5) + love.graphics.points({16,1}) + love.graphics.setBlendMode('multiply', 'premultiplied') + love.graphics.setColor(0, 1, 0, 1) + love.graphics.points({16,16}) + love.graphics.setBlendMode('replace', 'premultiplied') + love.graphics.setColor(0, 0, 1, 0.5) + love.graphics.points({1,16}) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + -- check the 4 corners + test:assertPixels(imgdata, { + redpale = {{0,0}}, + black = {{15,0}}, + greenhalf = {{15,15}}, + bluefade = {{0,15}} + }, 'blend mode') + love.graphics.setBlendMode('alpha', 'alphamultiply') -- reset end -- love.graphics.setCanvas love.test.graphics.setCanvas = function(test) -- make 2 canvas, set to each, draw one to the other, check output - test:skipTest('test method needs writing') + local canvas1 = love.graphics.newCanvas(16, 16) + local canvas2 = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas1) + test:assertEquals(canvas1, love.graphics.getCanvas(), 'check canvas 1 set') + love.graphics.clear(1, 0, 0, 1) + love.graphics.setCanvas(canvas2) + test:assertEquals(canvas2, love.graphics.getCanvas(), 'check canvas 2 set') + love.graphics.clear(0, 0, 0, 1) + love.graphics.draw(canvas1, 0, 0) + love.graphics.setCanvas() + test:assertEquals(nil, love.graphics.getCanvas(), 'check no canvas set') + local imgdata = love.graphics.readbackTexture(canvas2, {16, 0, 0, 0, 16, 16}) + -- check 2nd canvas is red + test:assertPixels(imgdata, { + red = {{0,0},{15,0},{15,15},{0,15}} + }, 'set canvas') end -- love.graphics.setColor love.test.graphics.setColor = function(test) -- set colors, draw rect, check color - test:skipTest('test method needs writing') + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.setColor(1, 0, 0, 1) + local r, g, b, a = love.graphics.getColor() + test:assertEquals(1, r, 'check r set') + test:assertEquals(0, g, 'check g set') + test:assertEquals(0, b, 'check b set') + test:assertEquals(1, a, 'check a set') + love.graphics.points({{1,1},{6,1},{11,1},{16,1}}) + love.graphics.setColor(1, 1, 0, 1) + love.graphics.points({{1,2},{6,2},{11,2},{16,2}}) + love.graphics.setColor(0, 1, 0, 0.5) + love.graphics.points({{1,3},{6,3},{11,3},{16,3}}) + love.graphics.setColor(0, 0, 1, 1) + love.graphics.points({{1,4},{6,4},{11,4},{16,4}}) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + red = {{0,0},{5,0},{10,0},{15,0}}, + yellow = {{0,1},{5,1},{10,1},{15,1}}, + greenhalf = {{0,2},{5,2},{10,2},{15,2}}, + blue = {{0,3},{5,3},{10,3},{15,3}} + }, 'set color') end -- love.graphics.setColorMask love.test.graphics.setColorMask = function(test) -- set mask, draw stuff, check output pixels - test:skipTest('test method needs writing') + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + -- mask off blue + love.graphics.setColorMask(true, true, false, true) + local r, g, b, a = love.graphics.getColorMask() + test:assertEquals(r, true, 'check r mask') + test:assertEquals(g, true, 'check g mask') + test:assertEquals(b, false, 'check b mask') + test:assertEquals(a, true, 'check a mask') + -- draw "black" which should then turn to yellow + love.graphics.setColor(1, 1, 1, 1) + love.graphics.rectangle('fill', 0, 0, 16, 16) + love.graphics.setColorMask(true, true, true, true) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + yellow = {{0,0},{0,15},{15,15},{15,0}} + }, 'set color mask') end @@ -656,67 +746,243 @@ end -- love.graphics.setDepthMode love.test.graphics.setDepthMode = function(test) - test:skipTest('test method needs writing') + -- check documented modes are valid + local comparemode, write = love.graphics.getDepthMode() + local modes = { + 'equal', 'notequal', 'less', 'lequal', 'gequal', + 'greater', 'never', 'always' + } + for m=1,#modes do + love.graphics.setDepthMode(modes[m], true) + test:assertEquals(modes[m], love.graphics.getDepthMode(), 'check depth mode ' .. modes[m] .. ' set') + end + love.graphics.setDepthMode(comparemode, write) + -- @TODO better graphics drawing specific test end -- love.graphics.setFont love.test.graphics.setFont = function(test) - test:skipTest('test method needs writing') + -- set font doesnt return anything so draw with the test font + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setFont(Font) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.setColor(1, 0, 0, 1) + love.graphics.print('love', 0, 3) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + red = { + {0,0},{0,6},{2,6},{6,2}, + {4,4},{8,4},{6,6},{10,2}, + {14,2},{12,6} + } + }, 'set font for print') end -- love.graphics.setFrontFaceWinding love.test.graphics.setFrontFaceWinding = function(test) - test:skipTest('test method needs writing') + -- check documented modes are valid + local original = love.graphics.getFrontFaceWinding() + love.graphics.setFrontFaceWinding('cw') + test:assertEquals('cw', love.graphics.getFrontFaceWinding(), 'check ffw cw set') + love.graphics.setFrontFaceWinding('ccw') + test:assertEquals('ccw', love.graphics.getFrontFaceWinding(), 'check ffw ccw set') + love.graphics.setFrontFaceWinding(original) + -- @TODO better graphics drawing specific test end -- love.graphics.setLineJoin love.test.graphics.setLineJoin = function(test) - test:skipTest('test method needs writing') + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setFont(Font) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + local line = {0,1,8,1,8,8} + love.graphics.setLineStyle('rough') + love.graphics.setLineWidth(2) + love.graphics.setColor(1, 0, 0) + love.graphics.setLineJoin('bevel') + love.graphics.line(line) + love.graphics.translate(0, 4) + love.graphics.setColor(1, 1, 0) + love.graphics.setLineJoin('none') + love.graphics.line(line) + love.graphics.translate(0, 4) + love.graphics.setColor(0, 0, 1) + love.graphics.setLineJoin('miter') + love.graphics.line(line) + love.graphics.setColor(1, 1, 1) + love.graphics.setLineWidth(1) + love.graphics.origin() + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + black = {{8,0}}, + red = {{8,4}}, + yellow = {{8,7}}, + blue = {{8,8}} + }, 'set line join') end -- love.graphics.setLineStyle love.test.graphics.setLineStyle = function(test) - test:skipTest('test method needs writing') + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setFont(Font) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.setColor(1, 0, 0) + local line = {0,1,16,1} + love.graphics.setLineStyle('rough') + love.graphics.line(line) + love.graphics.translate(0, 4) + love.graphics.setLineStyle('smooth') + love.graphics.line(line) + love.graphics.setLineStyle('rough') + love.graphics.setColor(1, 1, 1) + love.graphics.origin() + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + red = {{0,0},{7,0},{15,0}}, + red07 = {{0,4},{7,4},{15,4}} + }, 'set line style') end -- love.graphics.setLineWidth love.test.graphics.setLineWidth = function(test) - test:skipTest('test method needs writing') + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setFont(Font) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + local line = {0,1,8,1,8,8} + love.graphics.setColor(1, 0, 0) + love.graphics.setLineWidth(2) + love.graphics.line(line) + love.graphics.translate(0, 4) + love.graphics.setColor(1, 1, 0) + love.graphics.setLineWidth(3) + love.graphics.line(line) + love.graphics.translate(0, 4) + love.graphics.setColor(0, 0, 1) + love.graphics.setLineWidth(4) + love.graphics.line(line) + love.graphics.setColor(1, 1, 1) + love.graphics.setLineWidth(1) + love.graphics.origin() + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + black = {{0,2},{6,2},{0,6},{5,6},{0,11},{5,11}}, + red = {{0,0},{0,1},{7,2},{8,2}}, + yellow = {{0,3},{0,5},{6,6},{8,6}}, + blue = {{0,7},{0,10},{6,15},{9,15}} + }, 'set line width') end -- love.graphics.setMeshCullMode love.test.graphics.setMeshCullMode = function(test) - test:skipTest('test method needs writing') + -- check documented modes are valid + local original = love.graphics.getMeshCullMode() + local modes = {'back', 'front', 'none'} + for m=1,#modes do + love.graphics.setMeshCullMode(modes[m]) + test:assertEquals(modes[m], love.graphics.getMeshCullMode(), 'check mesh cull mode ' .. modes[m] .. ' was set') + end + love.graphics.setMeshCullMode(original) + -- @TODO better graphics drawing specific test end -- love.graphics.setScissor love.test.graphics.setScissor = function(test) - test:skipTest('test method needs writing') + -- make a scissor for the left half + -- then we should be able to fill the canvas with red and only left is filled + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.origin() + love.graphics.setScissor(0, 0, 8, 16) + love.graphics.clear(1, 0, 0, 1) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setScissor() + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + red = {{0,0},{7,0},{0,15},{7,15}}, + black ={{8,0},{8,15},{15,0},{15,15}} + }, 'set scissor') end -- love.graphics.setShader love.test.graphics.setShader = function(test) - test:skipTest('test method needs writing') + -- make a shader that will only ever draw yellow + local pixelcode = 'vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { vec4 texturecolor = Texel(tex, texture_coords); return vec4(1.0,1.0,0.0,1.0);}' + local vertexcode = 'vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; }' + local shader = love.graphics.newShader(pixelcode, vertexcode) + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.setShader(shader) + -- draw red rectangle + love.graphics.setColor(1, 0, 0, 1) + love.graphics.rectangle('fill', 0, 0, 16, 16) + love.graphics.setShader() + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + yellow = {{0,0},{15,0},{0,15},{15,15}}, + }, 'check shader set to yellow') end -- love.graphics.setStencilTest -love.test.graphics.setStencilMode = function(test) - test:skipTest('test method needs writing') +love.test.graphics.setStencilTest = function(test) + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas({canvas, stencil=true}) + love.graphics.clear(0, 0, 0, 1) + love.graphics.stencil(function() + love.graphics.circle('fill', 8, 8, 6) + end, 'replace', 1) + love.graphics.setStencilTest('greater', 0) + love.graphics.setColor(1, 0, 0, 1) + love.graphics.rectangle('fill', 0, 0, 16, 16) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setStencilTest() + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + red = {{6,2},{9,2},{2,6},{2,9},{13,6},{9,6},{6,13},{9,13}} + }, 'check stencil test') end -- love.graphics.setWireframe love.test.graphics.setWireframe = function(test) - test:skipTest('test method needs writing') + -- check wireframe outlines + love.graphics.setWireframe(true) + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.setColor(1, 1, 0, 1) + love.graphics.rectangle('fill', 2, 2, 13, 13) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setWireframe(false) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + yellow = {{1,14},{14,1},{14,14},{2,2},{13,13}}, + black = {{2,13},{13,2}} + }, 'set wireframe') end @@ -860,7 +1126,6 @@ love.test.graphics.rotate = function(test) love.graphics.setCanvas() local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) test:assertPixels(imgdata, { red = {{0,0},{3,0},{3,3},{0,3}} }, 'rotate 90') - imgdata:encode('png', 'rotate.png') end diff --git a/testing/tests/system.lua b/testing/tests/system.lua index 89b8eb400..432352ec5 100644 --- a/testing/tests/system.lua +++ b/testing/tests/system.lua @@ -30,10 +30,10 @@ love.test.system.getPowerInfo = function(test) test:assertMatch(states, state, 'check value matches') -- if percent/seconds check within expected range if percent ~= nil then - test:assertRange(percent, 0, 100, 'check value within range') + test:assertRange(percent, 0, 100, 'check battery percent within range') end if seconds ~= nil then - test:assertRange(seconds, 0, 100, 'check value within range') + test:assertNotNil(seconds) end end diff --git a/testing/tests/window.lua b/testing/tests/window.lua index bb656dea8..ae2cfdb9e 100644 --- a/testing/tests/window.lua +++ b/testing/tests/window.lua @@ -5,15 +5,13 @@ love.test.window.close = function(test) -- closing window should cause graphics to not be active love.window.close() - local active = false - if love.graphics ~= nil then - active = love.graphics.isActive() - end - test:assertEquals(false, active, 'check window active') - love.window.setMode(256, 256) -- reset + local active = love.graphics.isActive() + test:assertEquals(false, active, 'check window not active') + love.window.updateMode(360, 240) -- reset + active = love.graphics.isActive() + test:assertEquals(true, active, 'check window active again') end - -- love.window.fromPixels love.test.window.fromPixels = function(test) -- check dpi/pixel ratio as expected @@ -93,8 +91,8 @@ end -- @NOTE could prob add more checks on the flags here based on conf.lua love.test.window.getMode = function(test) local w, h, flags = love.window.getMode() - test:assertEquals(256, w, 'check w') - test:assertEquals(256, h, 'check h') + test:assertEquals(360, w, 'check w') + test:assertEquals(240, h, 'check h') test:assertEquals(false, flags["fullscreen"], 'check fullscreen') end @@ -169,13 +167,14 @@ end -- love.window.isMaximized love.test.window.isMaximized = function(test) - -- check minimized to start - love.window.minimize() - test:assertEquals(false, love.window.isMaximized(), 'check window maximized') - -- try to mazimize - love.window.maximize() - test:assertEquals(true, love.window.isMaximized(), 'check window not maximized') - love.window.restore() + if test:isDelayed() == false then + love.window.maximize() + test:setDelay(10) + else + -- on MACOS maximize wont get recognised immedietely so wait a few frames + test:assertEquals(true, love.window.isMaximized(), 'check window now maximized') + love.window.restore() + end end @@ -197,7 +196,7 @@ love.test.window.isOpen = function(test) -- try closing love.window.close() test:assertEquals(false, love.window.isOpen(), 'check window closed') - love.window.setMode(256, 256) -- reset + love.window.updateMode(360, 240) -- reset end @@ -208,16 +207,21 @@ love.test.window.isVisible = function(test) -- check closing makes window not visible love.window.close() test:assertEquals(false, love.window.isVisible(), 'check window not visible') - love.window.setMode(256, 256) -- reset + love.window.updateMode(360, 240) -- reset end -- love.window.maximize love.test.window.maximize = function(test) - -- check maximizing is set - love.window.maximize() - test:assertEquals(true, love.window.isMaximized(), 'check window maximized') - love.window.restore() + if test:isDelayed() == false then + -- check maximizing is set + love.window.maximize() + test:setDelay(10) + else + -- on macos we need to wait a few frames + test:assertEquals(true, love.window.isMaximized(), 'check window maximized') + love.window.restore() + end end @@ -293,7 +297,7 @@ love.test.window.setMode = function(test) test:assertEquals(512, height, 'check window h match') test:assertEquals(false, flags["fullscreen"], 'check window not fullscreen') test:assertEquals(false, flags["resizable"], 'check window not resizeable') - love.window.setMode(256, 256, { + love.window.setMode(360, 240, { fullscreen = false, resizable = true }) @@ -353,14 +357,14 @@ love.test.window.updateMode = function(test) resizable = false }) -- update mode with some props but not others - love.window.updateMode(256, 256, nil) + love.window.updateMode(360, 240, nil) -- check only changed values changed local width, height, flags = love.window.getMode() - test:assertEquals(256, width, 'check window w match') - test:assertEquals(256, height, 'check window h match') + test:assertEquals(360, width, 'check window w match') + test:assertEquals(240, height, 'check window h match') test:assertEquals(false, flags["fullscreen"], 'check window not fullscreen') test:assertEquals(false, flags["resizable"], 'check window not resizeable') - love.window.setMode(256, 256, { -- reset + love.window.setMode(360, 240, { -- reset fullscreen = false, resizable = true }) diff --git a/testing/todo.md b/testing/todo.md index 480c19e7a..37eac6bb7 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -1,18 +1,34 @@ `/Applications/love_12.app/Contents/MacOS/love ./testing` -## CI -- [ ] ignore test suite for windows AMD -- [ ] add test run to linux (opengl+vulkan) + ios builds (opengl+metal) - ## TESTSUITE -- [ ] finish graphics state methods +- [ ] setStencilMode to replace setStencilTest - [ ] start graphics drawing methods - [ ] start object methods +## GRAPHICS +Methods that need a better actual graphics check if possible: +- [ ] setDepthMode +- [ ] setFrontFaceWinding +- [ ] setMeshCullMode + ## FUTURE -- [ ] pass in err string returns to the test output - maybe even assertNotNil could use the second value automatically - test:assertNotNil(love.filesystem.openFile('file2', 'r')) wouldn't have to change -- [ ] some joystick/input stuff could be at least nil checked maybe? - [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) - could add platform as global to command and then use in tests? \ No newline at end of file + could add platform as global to command and then use in tests? +- [ ] use coroutines for the delay action? i.e. wrap each test call in coroutine + and then every test can use coroutine.yield() if needed +- [ ] could nil check some joystick and keyboard methods? + +## GITHUB ACTION CI +- [ ] linux needs to run xvfb-run with the appimage +- [ ] windows can try installing mesa for opengl replacement +- [ ] ios test run? + +Can't run --renderers metal on github action images: +Run love-macos/love.app/Contents/MacOS/love testing --renderers metal +Cannot create Metal renderer: Metal is not supported on this system. +Cannot create graphics: no supported renderer on this system. +Error: Cannot create graphics: no supported renderer on this system. + +Can't run test suite on windows as it stands: +Unable to create renderer +This program requires a graphics card and video drivers which support OpenGL 2.1 or OpenGL ES 2. From c7c8f25284a3d99b10276fd0ce16dbcb501c985b Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Sun, 8 Oct 2023 18:25:00 +0100 Subject: [PATCH 16/54] added objects module placeholders --- .github/workflows/main.yml | 14 +- testing/tests/data.lua | 6 +- testing/tests/event.lua | 2 +- testing/tests/graphics.lua | 30 +-- testing/tests/objects.lua | 366 ++++++++++++++++++++++++++++++------- 5 files changed, 326 insertions(+), 92 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fb1f58bf..4dbfab58d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,9 +50,9 @@ jobs: name: love-x86_64-AppImage-debug path: love-${{ github.sha }}.AppImage-debug.tar.gz - name: Make Runnable - run: chmod a+x love-linux-x86_64.AppImage + run: chmod a+x love-${{ github.sha }}.AppImage - name: Run All Tests - run: xvfb-run love-linux-x86_64.AppImage testing + run: xvfb-run love-${{ github.sha }}.AppImage testing - name: Love Test Report uses: ellraiser/love-test-report@main with: @@ -218,13 +218,11 @@ jobs: - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - - name: Install Mesa + - name: Install Mesa if: steps.vars.outputs.arch != 'ARM64' - run: | - curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z - 7z x mesa.7z - mklink opengl32.dll "x64\opengl32.dll" - mklink libglapi.dll "x64\libglapi.dll" + uses: ssciwr/setup-mesa-dist-win@v1 + with: + version: '23.2.1' - name: Run All Tests if: steps.vars.outputs.arch != 'ARM64' run: install\lovec.exe testing/main.lua diff --git a/testing/tests/data.lua b/testing/tests/data.lua index 76abdf5c7..dac5f3c06 100644 --- a/testing/tests/data.lua +++ b/testing/tests/data.lua @@ -121,7 +121,7 @@ end -- love.data.getPackedSize -- @NOTE I don't really get what lua packing types are so skipping for now - ell love.test.data.getPackedSize = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end @@ -161,12 +161,12 @@ end -- love.data.pack -- @NOTE I don't really get what lua packing types are so skipping for now - ell love.test.data.pack = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.data.unpack -- @NOTE I don't really get what lua packing types are so skipping for now - ell love.test.data.unpack = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end diff --git a/testing/tests/event.lua b/testing/tests/event.lua index 56650250f..ff667c394 100644 --- a/testing/tests/event.lua +++ b/testing/tests/event.lua @@ -69,5 +69,5 @@ end -- love.event.wait -- @NOTE not sure best way to test this one love.test.event.wait = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index 5e054d1f3..8ace6eaea 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -10,91 +10,91 @@ -- love.graphics.arc love.test.graphics.arc = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.circle love.test.graphics.circle = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.clear love.test.graphics.clear = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.discard love.test.graphics.discard = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.draw love.test.graphics.draw = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.drawInstanced love.test.graphics.drawInstanced = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.drawLayer love.test.graphics.drawLayer = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.ellipse love.test.graphics.ellipse = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.flushBatch love.test.graphics.flushBatch = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.line love.test.graphics.line = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.points love.test.graphics.points = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.polygon love.test.graphics.polygon = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.present love.test.graphics.present = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.print love.test.graphics.print = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end -- love.graphics.printf love.test.graphics.printf = function(test) - test:skipTest('test method needs writing') + test:skipTest('test class needs writing') end diff --git a/testing/tests/objects.lua b/testing/tests/objects.lua index 6ccd9dae0..2a03544b8 100644 --- a/testing/tests/objects.lua +++ b/testing/tests/objects.lua @@ -1,6 +1,93 @@ -- objects put in their own test methods to test all attributes and class methods +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------AUDIO--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- RecordingDevice (love.audio.getRecordingDevices) +love.test.objects.RecordingDevice = function(test) + test:skipTest('test class needs writing') +end + + +-- Source (love.audio.newSource) +love.test.objects.Source = function(test) + test:skipTest('test class needs writing') + -- local source1 = love.audio.newSource('resources/click.ogg', 'static') + --source1:clone() + --source1:getChannelCount() + --source1:getDuration() + --source1:isRelative() + --source1:queue() + --source1:getFreeBufferCount() + --source1:getType() + --source1:isPlaying() + --source1:play() + --source1:pause() + --source1:stop() + --source1:seek() + --source1:tell() + --source1:isLooping() + --source1:setLooping() + --source1:setAirAbsorption() + --source1:getAirAbsorption() + --source1:setAttenuationDistances() + --source1:getAttenuationDistances() + --source1:setCone() + --source1:getCone() + --source1:setDirection() + --source1:getDirection() + --source1:setEffect() + --source1:getEffect() + --source1:getActiveEffects() + --source1:setFilter() + --source1:getFilter() + --source1:setPitch() + --source1:getPitch() + --source1:setPosition() + --source1:getPosition() + --source1:setRelative() + --source1:setRolloff() + --source1:getRolloff() + --source1:setVelocity() + --source1:getVelocity() + --source1:setVolume() + --source1:getVolume() + --source1:setVolumeLimits() + --source1:getVolumeLimits() +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------DATA---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- ByteData (love.data.newByteData) +love.test.objects.ByteData = function(test) + test:skipTest('test class needs writing') +end + + +-- CompressedData (love.data.compress) +love.test.objects.CompressedData = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +---------------------------------FILESYSTEM------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- File (love.filesystem.newFile) love.test.objects.File = function(test) @@ -88,88 +175,237 @@ love.test.objects.File = function(test) end --- Source (love.audio.newSource) --- love.test.objects.Source = function(test) - -- local source1 = love.audio.newSource('resources/click.ogg', 'static') - --source1:clone() - --source1:getChannelCount() - --source1:getDuration() - --source1:isRelative() - --source1:queue() - --source1:getFreeBufferCount() - --source1:getType() - --source1:isPlaying() - --source1:play() - --source1:pause() - --source1:stop() - --source1:seek() - --source1:tell() - --source1:isLooping() - --source1:setLooping() - --source1:setAirAbsorption() - --source1:getAirAbsorption() - --source1:setAttenuationDistances() - --source1:getAttenuationDistances() - --source1:setCone() - --source1:getCone() - --source1:setDirection() - --source1:getDirection() - --source1:setEffect() - --source1:getEffect() - --source1:getActiveEffects() - --source1:setFilter() - --source1:getFilter() - --source1:setPitch() - --source1:getPitch() - --source1:setPosition() - --source1:getPosition() - --source1:setRelative() - --source1:setRolloff() - --source1:getRolloff() - --source1:setVelocity() - --source1:getVelocity() - --source1:setVolume() - --source1:getVolume() - --source1:setVolumeLimits() - --source1:getVolumeLimits() --- end - -- FileData (love.filesystem.newFileData) +love.test.objects.FileData = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------FONT---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- --- ByteData (love.data.newByteData) --- DataView (love.data.newDataView) --- FontData (love.font.newFontData) -- GlyphData (love.font.newGlyphData) +love.test.objects.GlyphData = function(test) + test:skipTest('test class needs writing') +end + + -- Rasterizer (love.font.newRasterizer) +love.test.objects.Rasterizer = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +---------------------------------GRAPHICS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Canvas (love.graphics.newCanvas) +love.test.objects.Canvas = function(test) + test:skipTest('test class needs writing') +end + + +-- Font (love.graphics.newFont) +love.test.objects.Font = function(test) + test:skipTest('test class needs writing') +end + + +-- Image (love.graphics.newImage) +love.test.objects.Image = function(test) + test:skipTest('test class needs writing') +end + + +-- Mesh (love.graphics.newMesh) +love.test.objects.Mesh = function(test) + test:skipTest('test class needs writing') +end + + +-- ParticleSystem (love.graphics.newParticleSystem) +love.test.objects.ParticleSystem = function(test) + test:skipTest('test class needs writing') +end + + +-- Quad (love.graphics.newQuad) +love.test.objects.Quad = function(test) + test:skipTest('test class needs writing') +end + + +-- Shader (love.graphics.newShader) +love.test.objects.Shader = function(test) + test:skipTest('test class needs writing') +end + + +-- SpriteBatch (love.graphics.newSpriteBatch) +love.test.objects.SpriteBatch = function(test) + test:skipTest('test class needs writing') +end + + +-- Text (love.graphics.newTextBatch) +love.test.objects.Text = function(test) + test:skipTest('test class needs writing') +end + + +-- Texture (love.graphics.newTexture) +love.test.objects.Texture = function(test) + test:skipTest('test class needs writing') +end + + +-- Video (love.graphics.newVideo) +love.test.objects.Video = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-----------------------------------IMAGE---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + -- CompressedImageData (love.image.newCompressedImageData) +love.test.objects.CompressedImageData = function(test) + test:skipTest('test class needs writing') +end + + -- ImageData (love.image.newImageData) +love.test.objects.ImageData = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------MATH---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + -- BezierCurve (love.math.newBezierCurve) +love.test.objects.BezierCurve = function(test) + test:skipTest('test class needs writing') +end + + -- RandomGenerator (love.math.RandomGenerator) +love.test.objects.RandomGenerator = function(test) + test:skipTest('test class needs writing') +end + + -- Transform (love.math.Transform) +love.test.objects.Transform = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------PHYSICS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Body (love.physics.newBody) +love.test.objects.Body = function(test) + test:skipTest('test class needs writing') +end + + +-- Contact (love.physics.World:getContacts) +love.test.objects.Contact = function(test) + test:skipTest('test class needs writing') +end + + +-- Fixture (love.physics.newFixture) +love.test.objects.Fixture = function(test) + test:skipTest('test class needs writing') +end + + +-- Joint (love.physics.newDistanceJoint) +love.test.objects.Joint = function(test) + test:skipTest('test class needs writing') +end + + +-- Shape (love.physics.newCircleShape) +love.test.objects.Shape = function(test) + test:skipTest('test class needs writing') +end + + +-- World (love.physics.newWorld) +love.test.objects.World = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-----------------------------------SOUND---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + -- Decoder (love.sound.newDecoder) +love.test.objects.Decoder = function(test) + test:skipTest('test class needs writing') +end + + -- SoundData (love.sound.newSoundData) +love.test.objects.SoundData = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------THREAD---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + -- Channel (love.thread.newChannel) +love.test.objects.Channel = function(test) + test:skipTest('test class needs writing') +end + + -- Thread (love.thread.newThread) +love.test.objects.Thread = function(test) + test:skipTest('test class needs writing') +end --- VideoStream (love.thread.newVideoStream) --- all the stuff from love.physics! barf - --- (love.graphics objs) --- Canvas --- Font --- Image --- Framebugger --- Mesh --- ParticleSystem --- PixelEffect --- Quad --- Shader --- SpriteBatch --- Text --- Video +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-----------------------------------VIDEO---------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- VideoStream (love.thread.newVideoStream) +love.test.objects.VideoStream = function(test) + test:skipTest('test class needs writing') +end From add23a4ab0817573470481e446b077ea22174637 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:11:07 +0100 Subject: [PATCH 17/54] fix mesa install --- .github/workflows/main.yml | 15 +++++++------- testing/classes/TestModule.lua | 2 +- testing/classes/TestSuite.lua | 2 +- testing/examples/lovetest_runAllTests.md | 26 ++++++++++++++++++++++++ testing/readme.md | 16 +++++++-------- testing/todo.md | 12 ++++------- 6 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 testing/examples/lovetest_runAllTests.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4dbfab58d..7b0801aab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,7 @@ jobs: - name: Make Runnable run: chmod a+x love-${{ github.sha }}.AppImage - name: Run All Tests - run: xvfb-run love-${{ github.sha }}.AppImage testing + run: xvfb-run ./love-${{ github.sha }}.AppImage testing - name: Love Test Report uses: ellraiser/love-test-report@main with: @@ -215,17 +215,18 @@ jobs: with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb + - name: Install Mesa + if: steps.vars.outputs.arch != 'ARM64' + run: | + curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z + 7z x mesa.7z -o* + powershell.exe mesa\systemwidedeploy.cmd 1 - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - - name: Install Mesa - if: steps.vars.outputs.arch != 'ARM64' - uses: ssciwr/setup-mesa-dist-win@v1 - with: - version: '23.2.1' - name: Run All Tests if: steps.vars.outputs.arch != 'ARM64' - run: install\lovec.exe testing/main.lua + run: powershell.exe install/lovec.exe testing - name: Love Test Report if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main diff --git a/testing/classes/TestModule.lua b/testing/classes/TestModule.lua index fa71ddb74..89fd1f7fa 100644 --- a/testing/classes/TestModule.lua +++ b/testing/classes/TestModule.lua @@ -12,7 +12,7 @@ TestModule = { local testmodule = { timer = 0, time = 0, - delay = 0.1, + delay = 0.01, spacer = ' ', colors = { PASS = 'green', FAIL = 'red', SKIP = 'grey' diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 92094ae88..8d9ce368c 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -58,7 +58,7 @@ TestSuite = { -- @return {nil} runSuite = function(self, delta) - -- stagger 0.1s between tests + -- stagger between tests if self.module ~= nil then self.module.timer = self.module.timer + delta if self.module.timer >= self.module.delay then diff --git a/testing/examples/lovetest_runAllTests.md b/testing/examples/lovetest_runAllTests.md new file mode 100644 index 000000000..4fabcde1d --- /dev/null +++ b/testing/examples/lovetest_runAllTests.md @@ -0,0 +1,26 @@ + + +**305** tests were completed in **37.853s** with **244** passed, **0** failed, and **61** skipped + +### Report +| Module | Passed | Failed | Skipped | Time | +| --------------------- | ------ | ------ | ------- | ------ | +| 🟢 love.audio | 26 | 0 | 0 | 2.605s | +| 🟢 love.data | 7 | 0 | 3 | 1.003s | +| 🟢 love.event | 4 | 0 | 2 | 0.600s | +| 🟢 love.filesystem | 27 | 0 | 2 | 3.030s | +| 🟢 love.font | 4 | 0 | 1 | 0.511s | +| 🟢 love.graphics | 81 | 0 | 15 | 10.599s | +| 🟢 love.image | 3 | 0 | 0 | 0.299s | +| 🟢 love.math | 17 | 0 | 0 | 1.821s | +| 🟢 love.objects | 1 | 0 | 34 | 3.603s | +| 🟢 love.physics | 22 | 0 | 0 | 2.222s | +| 🟢 love.sound | 2 | 0 | 0 | 0.199s | +| 🟢 love.system | 6 | 0 | 2 | 0.844s | +| 🟢 love.thread | 3 | 0 | 0 | 0.318s | +| 🟢 love.timer | 6 | 0 | 0 | 2.309s | +| 🟢 love.video | 1 | 0 | 0 | 0.114s | +| 🟢 love.window | 34 | 0 | 2 | 7.778s | + + +### Failures diff --git a/testing/readme.md b/testing/readme.md index 32842061b..f322f7dd5 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -35,9 +35,10 @@ If you want to specify only 1 specific method only you can use: All results will be printed in the console per method as PASS, FAIL, or SKIP with total assertions met on a module level and overall level. -An `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format) will be generated in the `/output` directory, along with a `HTML` file with a summary of all tests (including visuals for love.graphics tests) - you will need to make sure the command is run with read/write permissions for the source directory. -> Note that this can only be viewed properly locally as the generated images are written to the save directory. -> An example of both types of output can be found in the `/examples` folder +An `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format) will be generated in the `/output` directory, along with a `HTML` and a `Markdown` file with a summary of all tests (including visuals for love.graphics tests). +> An example of both types of output can be found in the `/examples` folder + +The Markdown file can be used with [this github action](https://github.com/ellraiser/love-test-report) if you want to output the report results to your CI. --- @@ -81,7 +82,6 @@ For sanity-checking, if it's currently not covered or we're not sure how to test ## Coverage This is the status of all module tests currently. -"objects" is a special module to cover any object specific tests, i.e. testing a File object functions as expected | Module | Passed | Failed | Skipped | Time | | --------------------- | ------ | ------ | ------- | ------ | | 🟢 love.audio | 26 | 0 | 0 | 2.602s | @@ -92,22 +92,20 @@ This is the status of all module tests currently. | 🟢 love.graphics | 81 | 0 | 15 | 10.678s | | 🟢 love.image | 3 | 0 | 0 | 0.300s | | 🟢 love.math | 17 | 0 | 0 | 1.678s | -| 🟢 love.objects | 1 | 0 | 0 | 0.121s | | 🟢 love.physics | 22 | 0 | 0 | 2.197s | | 🟢 love.sound | 2 | 0 | 0 | 0.200s | | 🟢 love.system | 6 | 0 | 2 | 0.802s | | 🟢 love.thread | 3 | 0 | 0 | 0.300s | | 🟢 love.timer | 6 | 0 | 0 | 2.358s | | 🟢 love.video | 1 | 0 | 0 | 0.100s | -| 🟢 love.window | 34 | 0 | 2 | 8.050s | -**271** tests were completed in **34.387s** with **244** passed, **0** failed, and **27** skipped +| 🟢 love.window | 34 | 0 | 2 | 8.050s | The following modules are not covered as we can't really emulate input nicely: `joystick`, `keyboard`, `mouse`, and `touch` --- -## Todo / Skipped +## Todo Modules with some small bits needed or needing sense checking: - **love.data** - packing methods need writing cos i dont really get what they are - **love.event** - love.event.wait or love.event.pump need writing if possible I dunno how to check @@ -115,7 +113,7 @@ Modules with some small bits needed or needing sense checking: - **love.graphics** - still need to do tests for the main drawing methods - **love.image** - ideally isCompressed should have an example of all compressed files love can take - **love.math** - linearToGamma + gammaToLinear using direct formulas don't get same value back -- **love.objects** - not started properly yet +- **love.*.objects** - all objects tests still to be done - **love.graphics.setStencilTest** - deprecated, replaced by setStencilMode() --- diff --git a/testing/todo.md b/testing/todo.md index 37eac6bb7..5634cbca7 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -3,32 +3,28 @@ ## TESTSUITE - [ ] setStencilMode to replace setStencilTest - [ ] start graphics drawing methods +- [ ] move object methods to respective modules - [ ] start object methods ## GRAPHICS -Methods that need a better actual graphics check if possible: +Methods that need a actual graphic pixel checks if possible: - [ ] setDepthMode - [ ] setFrontFaceWinding - [ ] setMeshCullMode ## FUTURE - [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) - could add platform as global to command and then use in tests? - [ ] use coroutines for the delay action? i.e. wrap each test call in coroutine - and then every test can use coroutine.yield() if needed - [ ] could nil check some joystick and keyboard methods? ## GITHUB ACTION CI - [ ] linux needs to run xvfb-run with the appimage -- [ ] windows can try installing mesa for opengl replacement +- [ ] try vulkan on windows/linux - [ ] ios test run? +## NOTES Can't run --renderers metal on github action images: Run love-macos/love.app/Contents/MacOS/love testing --renderers metal Cannot create Metal renderer: Metal is not supported on this system. Cannot create graphics: no supported renderer on this system. Error: Cannot create graphics: no supported renderer on this system. - -Can't run test suite on windows as it stands: -Unable to create renderer -This program requires a graphics card and video drivers which support OpenGL 2.1 or OpenGL ES 2. From f477b8085f945eeeadb4cede78c68aa0089d04d5 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Mon, 9 Oct 2023 22:32:41 +0100 Subject: [PATCH 18/54] finish graphics module + HTML image comparison - added mostly all graphics draw tests - added a basic set of "expected" images (generated from successful tests) - HTML output now shows the expected vs actual generated images for each of the graphics tests applicable --- .github/workflows/main.yml | 33 +- .gitignore | 1 + testing/classes/TestMethod.lua | 38 ++- testing/classes/TestModule.lua | 2 +- testing/classes/TestSuite.lua | 2 - testing/main.lua | 3 + testing/output/actual/notes.txt | 2 + .../love.test.graphics.applyTransform-1.png | Bin 0 -> 89 bytes .../expected/love.test.graphics.arc-1.png | Bin 0 -> 245 bytes .../expected/love.test.graphics.arc-2.png | Bin 0 -> 204 bytes .../expected/love.test.graphics.arc-3.png | Bin 0 -> 223 bytes .../expected/love.test.graphics.circle-1.png | Bin 0 -> 212 bytes .../expected/love.test.graphics.clear-1.png | Bin 0 -> 84 bytes .../expected/love.test.graphics.draw-1.png | Bin 0 -> 221 bytes .../love.test.graphics.drawLayer-1.png | Bin 0 -> 386 bytes .../expected/love.test.graphics.ellipse-1.png | Bin 0 -> 185 bytes .../love.test.graphics.intersectScissor-1.png | Bin 0 -> 91 bytes .../expected/love.test.graphics.line-1.png | Bin 0 -> 139 bytes .../expected/love.test.graphics.origin-1.png | Bin 0 -> 90 bytes .../expected/love.test.graphics.points-1.png | Bin 0 -> 111 bytes .../expected/love.test.graphics.polygon-1.png | Bin 0 -> 154 bytes .../expected/love.test.graphics.pop-1.png | Bin 0 -> 90 bytes .../expected/love.test.graphics.print-1.png | Bin 0 -> 154 bytes .../expected/love.test.graphics.printf-1.png | Bin 0 -> 196 bytes .../expected/love.test.graphics.push-1.png | Bin 0 -> 91 bytes .../love.test.graphics.rectangle-1.png | Bin 0 -> 92 bytes .../love.test.graphics.rectangle-2.png | Bin 0 -> 103 bytes .../love.test.graphics.replaceTransform-1.png | Bin 0 -> 89 bytes .../expected/love.test.graphics.rotate-1.png | Bin 0 -> 91 bytes .../love.test.graphics.setBlendMode-1.png | Bin 0 -> 123 bytes .../love.test.graphics.setCanvas-1.png | Bin 0 -> 84 bytes .../love.test.graphics.setColor-1.png | Bin 0 -> 128 bytes .../love.test.graphics.setColorMask-1.png | Bin 0 -> 99 bytes .../expected/love.test.graphics.setFont-1.png | Bin 0 -> 106 bytes .../love.test.graphics.setLineJoin-1.png | Bin 0 -> 122 bytes .../love.test.graphics.setLineStyle-1.png | Bin 0 -> 102 bytes .../love.test.graphics.setLineWidth-1.png | Bin 0 -> 118 bytes .../love.test.graphics.setScissor-1.png | Bin 0 -> 89 bytes .../love.test.graphics.setShader-1.png | Bin 0 -> 84 bytes .../love.test.graphics.setStencilTest-1.png | Bin 0 -> 107 bytes .../love.test.graphics.setWireframe-1.png | Bin 0 -> 128 bytes .../expected/love.test.graphics.shear-1.png | Bin 0 -> 98 bytes .../expected/love.test.graphics.shear-2.png | Bin 0 -> 101 bytes .../love.test.graphics.translate-1.png | Bin 0 -> 93 bytes testing/output/expected/notes.txt | 2 + testing/output/{readme.md => notes.txt} | 0 testing/resources/loveinv.png | Bin 0 -> 680 bytes testing/tests/graphics.lua | 310 +++++++++++++++++- testing/todo.md | 5 +- 49 files changed, 366 insertions(+), 32 deletions(-) create mode 100644 testing/output/actual/notes.txt create mode 100644 testing/output/expected/love.test.graphics.applyTransform-1.png create mode 100644 testing/output/expected/love.test.graphics.arc-1.png create mode 100644 testing/output/expected/love.test.graphics.arc-2.png create mode 100644 testing/output/expected/love.test.graphics.arc-3.png create mode 100644 testing/output/expected/love.test.graphics.circle-1.png create mode 100644 testing/output/expected/love.test.graphics.clear-1.png create mode 100644 testing/output/expected/love.test.graphics.draw-1.png create mode 100644 testing/output/expected/love.test.graphics.drawLayer-1.png create mode 100644 testing/output/expected/love.test.graphics.ellipse-1.png create mode 100644 testing/output/expected/love.test.graphics.intersectScissor-1.png create mode 100644 testing/output/expected/love.test.graphics.line-1.png create mode 100644 testing/output/expected/love.test.graphics.origin-1.png create mode 100644 testing/output/expected/love.test.graphics.points-1.png create mode 100644 testing/output/expected/love.test.graphics.polygon-1.png create mode 100644 testing/output/expected/love.test.graphics.pop-1.png create mode 100644 testing/output/expected/love.test.graphics.print-1.png create mode 100644 testing/output/expected/love.test.graphics.printf-1.png create mode 100644 testing/output/expected/love.test.graphics.push-1.png create mode 100644 testing/output/expected/love.test.graphics.rectangle-1.png create mode 100644 testing/output/expected/love.test.graphics.rectangle-2.png create mode 100644 testing/output/expected/love.test.graphics.replaceTransform-1.png create mode 100644 testing/output/expected/love.test.graphics.rotate-1.png create mode 100644 testing/output/expected/love.test.graphics.setBlendMode-1.png create mode 100644 testing/output/expected/love.test.graphics.setCanvas-1.png create mode 100644 testing/output/expected/love.test.graphics.setColor-1.png create mode 100644 testing/output/expected/love.test.graphics.setColorMask-1.png create mode 100644 testing/output/expected/love.test.graphics.setFont-1.png create mode 100644 testing/output/expected/love.test.graphics.setLineJoin-1.png create mode 100644 testing/output/expected/love.test.graphics.setLineStyle-1.png create mode 100644 testing/output/expected/love.test.graphics.setLineWidth-1.png create mode 100644 testing/output/expected/love.test.graphics.setScissor-1.png create mode 100644 testing/output/expected/love.test.graphics.setShader-1.png create mode 100644 testing/output/expected/love.test.graphics.setStencilTest-1.png create mode 100644 testing/output/expected/love.test.graphics.setWireframe-1.png create mode 100644 testing/output/expected/love.test.graphics.shear-1.png create mode 100644 testing/output/expected/love.test.graphics.shear-2.png create mode 100644 testing/output/expected/love.test.graphics.translate-1.png create mode 100644 testing/output/expected/notes.txt rename testing/output/{readme.md => notes.txt} (100%) create mode 100644 testing/resources/loveinv.png diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b0801aab..5229bdaf8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: [push, pull_request] jobs: linux-os: runs-on: ubuntu-20.04 + timeout-minutes: 60 steps: - name: Update APT run: sudo apt-get update @@ -50,9 +51,12 @@ jobs: name: love-x86_64-AppImage-debug path: love-${{ github.sha }}.AppImage-debug.tar.gz - name: Make Runnable - run: chmod a+x love-${{ github.sha }}.AppImage + run: | + chmod a+x love-${{ github.sha }}.AppImage + echo "ready to run" + ls - name: Run All Tests - run: xvfb-run ./love-${{ github.sha }}.AppImage testing + run: xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua - name: Love Test Report uses: ellraiser/love-test-report@main with: @@ -61,6 +65,7 @@ jobs: path: testing/output/lovetest_runAllTests.md windows-os: runs-on: windows-latest + timeout-minutes: 60 strategy: matrix: platform: [Win32, x64, ARM64] @@ -214,9 +219,21 @@ jobs: uses: actions/upload-artifact@v3 with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg - path: pdb/Release/*.pdb + path: pdb/Release/*.pdb + - name: Install Scream + shell: powershell + run: | + Start-Service audio* + Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip + Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream + $cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate + $store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine") + $store.Open("ReadWrite") + $store.Add($cert) + $store.Close() + cd C:\Scream\Install\driver + C:\Scream\Install\helpers\devcon install Scream.inf *Scream - name: Install Mesa - if: steps.vars.outputs.arch != 'ARM64' run: | curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z 7z x mesa.7z -o* @@ -226,7 +243,9 @@ jobs: run: cmake --build build --config Release --target install - name: Run All Tests if: steps.vars.outputs.arch != 'ARM64' - run: powershell.exe install/lovec.exe testing + run: | + dir + powershell.exe ./install/lovec.exe ./testing/main.lua - name: Love Test Report if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main @@ -236,6 +255,7 @@ jobs: path: testing/output/lovetest_runAllTests.md macOS: runs-on: macos-latest + timeout-minutes: 60 steps: - name: Checkout uses: actions/checkout@v3 @@ -263,7 +283,7 @@ jobs: name: love-macos path: love-macos.zip - name: Run All Tests - run: love-macos/love.app/Contents/MacOS/love testing + run: love-macos/love.app/Contents/MacOS/love testing/main.lua - name: Love Test Report uses: ellraiser/love-test-report@main with: @@ -272,6 +292,7 @@ jobs: path: testing/output/lovetest_runAllTests.md iOS-Simulator: runs-on: macos-latest + timeout-minutes: 60 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index f84038cd7..3f5288d45 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ stamp-h1 /testing/output/*.xml /testing/output/*.html /testing/output/*.md +/testing/output/actual/*.png diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 9b355a6bb..ad3a742e6 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -33,9 +33,13 @@ TestMethod = { blue = {0, 0, 1, 1}, bluefade = {0, 0, 1, 0.5}, yellow = {1, 1, 0, 1}, + pink = {1, 0, 1, 1}, black = {0, 0, 0, 1}, - white = {1, 1, 1, 1} + white = {1, 1, 1, 1}, + lovepink = {214/255, 86/255, 151/255, 1}, + loveblue = {83/255, 168/255, 220/255, 1} }, + imgs = 1, delay = 0, delayed = false } @@ -82,6 +86,10 @@ TestMethod = { tg = math.floor((tg*10)+0.5)/10 tb = math.floor((tb*10)+0.5)/10 ta = math.floor((ta*10)+0.5)/10 + col[1] = math.floor((col[1]*10)+0.5)/10 + col[2] = math.floor((col[2]*10)+0.5)/10 + col[3] = math.floor((col[3]*10)+0.5)/10 + col[4] = math.floor((col[4]*10)+0.5)/10 -- @TODO add some sort pixel tolerance to the coords self:assertEquals(col[1], tr, 'check pixel r for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') self:assertEquals(col[2], tg, 'check pixel g for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')') @@ -227,6 +235,14 @@ TestMethod = { end, + exportImg = function(self, imgdata) + local path = 'tempoutput/actual/love.test.graphics.' .. + self.method .. '-' .. tostring(self.imgs) .. '.png' + imgdata:encode('png', path) + self.imgs = self.imgs + 1 + end, + + -- @method - TestMethod:skipTest() -- @desc - used to mark this test as skipped for a specific reason -- @param {string} reason - reason why method is being skipped @@ -356,11 +372,21 @@ TestMethod = { -- unused currently, adds a preview image for certain graphics methods to the output local preview = '' - -- if self.testmodule.module == 'graphics' then - -- local filename = 'love_test_graphics_rectangle' - -- preview = '
    ' .. '

    Expected

    ' .. - -- '

    Actual

    ' - -- end + if self.testmodule.module == 'graphics' then + local filename = 'love.test.graphics.' .. self.method + if love.filesystem.openFile('tempoutput/actual/' .. filename .. '-1.png', 'r') then + preview = '
    ' .. '

    Expected

    ' .. + '
    ' .. '

    Actual

    ' + end + if love.filesystem.openFile('tempoutput/actual/' .. filename .. '-2.png', 'r') then + preview = preview .. '
    ' .. '

    Expected

    ' .. + '
    ' .. '

    Actual

    ' + end + if love.filesystem.openFile('tempoutput/actual/' .. filename .. '-3.png', 'r') then + preview = preview .. '
    ' .. '

    Expected

    ' .. + '
    ' .. '

    Actual

    ' + end + end -- append HTML for the test class result local status = '🔴' diff --git a/testing/classes/TestModule.lua b/testing/classes/TestModule.lua index 89fd1f7fa..dae7d82ed 100644 --- a/testing/classes/TestModule.lua +++ b/testing/classes/TestModule.lua @@ -88,7 +88,7 @@ TestModule = { if self.failed == 0 then status = '🟢' end -- add md row to main output love.test.mdrows = love.test.mdrows .. '| ' .. status .. - ' love.' .. self.module .. + ' ' .. self.module .. ' | ' .. tostring(self.passed) .. ' | ' .. tostring(self.failed) .. ' | ' .. tostring(self.skipped) .. diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 8d9ce368c..cbe171c31 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -187,8 +187,6 @@ TestSuite = { '
  • 🟡 ' .. tostring(self.totals[3]) .. ' Skipped
  • ' .. '
  • ' .. finaltime .. 's


' - -- @TODO use mountFullPath to write output to src? - love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite") love.filesystem.write('tempoutput/' .. self.output .. '.xml', xml .. self.xml .. '') love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '') love.filesystem.write('tempoutput/' .. self.output .. '.md', md) diff --git a/testing/main.lua b/testing/main.lua index 292ad82c6..523d536d6 100644 --- a/testing/main.lua +++ b/testing/main.lua @@ -53,6 +53,9 @@ love.load = function(args) end end + -- mount for output later + love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite") + -- get all args with any comma lists split out as seperate local arglist = {} for a=1,#args do diff --git a/testing/output/actual/notes.txt b/testing/output/actual/notes.txt new file mode 100644 index 000000000..2716b1df8 --- /dev/null +++ b/testing/output/actual/notes.txt @@ -0,0 +1,2 @@ +# Actual Graphics Output +The images generated by the tests \ No newline at end of file diff --git a/testing/output/expected/love.test.graphics.applyTransform-1.png b/testing/output/expected/love.test.graphics.applyTransform-1.png new file mode 100644 index 0000000000000000000000000000000000000000..f80ad8f855197459002a951418f9f3634fb4fb80 GIT binary patch literal 89 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9E0F%rz##p<7bL>x>Eakt hF()}8AVGnZfr0e{gJSsX)Tclh22WQ%mvv4FO#qOZ5*7de literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.arc-1.png b/testing/output/expected/love.test.graphics.arc-1.png new file mode 100644 index 0000000000000000000000000000000000000000..f95e65bb33dc252eb431a6b7164b2b30ff5773aa GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@o&cW^S0Mc#1Q`A^Fho4oUk2na z@pN$vshE>{!I0~ag8=J=`56M*x|7abyQlm{km*@Er&!n{RTh6i8%HVq#J(rI*X)xO z6#O>#&z+l?&XAJQ;OaVsPpEZnYr`#Lri@e?xqV@w~2ZFHYN= zuhJ4NS~;&*9a_v7<|Lgdal^H?uGv<9qG_3v{7sJ6(*pPMpRjh8n8@GunByvUx_rQn npC=Bz@b1|2TWHgadk5G*9Wpmg`o*jbbT5OatDnm{r-UW||0G#e literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.arc-2.png b/testing/output/expected/love.test.graphics.arc-2.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ae7e649bb82c4412e1cb92901f75f97965acdf GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@o&cW^S0Mc#2tXtQ<6_YWAivtv z#WAE}PH*2v!3G5$*Zs?{MeX44OL%P8_kcsJO1zopr04vs06951J literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.circle-1.png b/testing/output/expected/love.test.graphics.circle-1.png new file mode 100644 index 0000000000000000000000000000000000000000..dbc1304073622223d5f2bb98ed77014719033eb0 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv{s5m4S0Mc#h(G|uvRvry4iswe zba4!+m{U9HwBP{+4wtRWTbVuC5AtpKKdWhx+a}|i()nUf78l3bbv51o)ahb*E5c*L z#tEDm-jgqJyIo3D;JUUTRK!64LAs4+KtXANw#VrO(`*_fyh2YiE!|qh5O#n)V^RGF z&&EX`)@1TTwLeU#i4j;MFs&!O!TF%(#~aVAZTM5HlPCPzv=QhQ22WQ%mvv4FO#mnc BPe=d& literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.clear-1.png b/testing/output/expected/love.test.graphics.clear-1.png new file mode 100644 index 0000000000000000000000000000000000000000..315c7a936f3dc201ea118e957e50a50e5f26b1f7 GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5X>;L}@UB|w-0=Yb%E{-7; dbCMGjc!4|v21c>YSr>sU22WQ%mvv4FO#qBk5)l9Z literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.draw-1.png b/testing/output/expected/love.test.graphics.draw-1.png new file mode 100644 index 0000000000000000000000000000000000000000..6318b14a4830af9a595dc40007227bb527446c7f GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@o&cW^*K1+Z|1&TIuekI7|NmQB z3#EbLJ)SO(Ar*64&l&PH8wj{uWGv5&`DvqOz92#GrCRxk!WEOmTz&R1cfHs&X{mm8 zs=dghj-B#`Nw30RhR&bCZdAV|(JgUmnU2H?<)A`=pS5oH3w(n19$`Bd8W|<)ne||j zX;#0-F57EzEm86@>0dazZ4)=D&-*U^apAus`Ib80T8_@!a6?$E`cRU;^>c1l*IDI0 S;zl5MF?hQAxvX0!Gc6!x4C*Kq=@Op3OT}aP{sdam9~I zJC`uzUZjf@k#^=@RA@>s^xhhV19!Q}${Fgx7OcuCTy6_{Ht{dMpun2kEX(B;Gxy7XHik*j zjB+CGZzE))W_4WZ{?vG;Kz)|z#fCc_n-naRHvbVe_&kkASNdF*MV^a$!2)L^W-A7( dWAzdu;=9Vqo-SlubpdE6gQu&X%Q~loCIGzfJB9!N literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.intersectScissor-1.png b/testing/output/expected/love.test.graphics.intersectScissor-1.png new file mode 100644 index 0000000000000000000000000000000000000000..7c40b8c9e8c4c8aeda3f0e8668d425043bee5049 GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9>wh4Ffx&UH5J*D6)5S5Q jVovgd|K}Op|8puc#J-bJgTe~DWM4f&OH;7 literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.line-1.png b/testing/output/expected/love.test.graphics.line-1.png new file mode 100644 index 0000000000000000000000000000000000000000..6fa77e263a1a310f430b69fe165a461122dd46ed GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|uK)it{0Fib7&sPtECf=v zo-U3d6?2jWczJmfKSXWKQgptwDs(Q7*Q+}JDGSJi2&t;ucLK6T!h$e;r literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.origin-1.png b/testing/output/expected/love.test.graphics.origin-1.png new file mode 100644 index 0000000000000000000000000000000000000000..e018bbfbc4bf35f890c70e81e0aa15c5e1d21d21 GIT binary patch literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9>wh4Ffx&UH5J-aG)5S5Q iVovgk|K~rYn_BGKs0d4pj>AVc_5(ahpq&kg_;GkCiCxvX
wh4Ffx&UH5J-aG)5S5Q iVovgk|K~r=*%m~z_9kWNcr}cvv&fmXYh3Ob6Mw<&;$Tsggnsz literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.push-1.png b/testing/output/expected/love.test.graphics.push-1.png new file mode 100644 index 0000000000000000000000000000000000000000..58ace03b31caf4aa1e1ceae60811a2cd1342efd5 GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9>wh4Ffx&UH5J*D6)5S5Q jVoq|xhV%o>QWpdnG?wh4F;eXD;zkNVj(9^{+ kq+(8T!U2Xe>;fD>weHuLc|T^Xt^uj?boFyt=akR{047)!8vpx>Eakt hF()}8AVGnZfr0e{gJSsX)Tclh22WQ%mvv4FO#qOZ5*7de literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.rotate-1.png b/testing/output/expected/love.test.graphics.rotate-1.png new file mode 100644 index 0000000000000000000000000000000000000000..7c40b8c9e8c4c8aeda3f0e8668d425043bee5049 GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9>wh4Ffx&UH5J*D6)5S5Q jVovgd|K}Op|8puc#J-bJgTe~DWM4f&OH;7 literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setBlendMode-1.png b/testing/output/expected/love.test.graphics.setBlendMode-1.png new file mode 100644 index 0000000000000000000000000000000000000000..71ad3bdd94807a7db7a898e8f9ed2b2325871cd0 GIT binary patch literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b{oeorjEsy74F4G#7$n`r z;(<~uB|(0{|NsB5Zf!s$uV`#o%R<% OB@CXfelF{r5}E)E&>(vN literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setCanvas-1.png b/testing/output/expected/love.test.graphics.setCanvas-1.png new file mode 100644 index 0000000000000000000000000000000000000000..a97348e509ee00fea8cf1432a82a5b89df82c91a GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5X>wg9Y$w!>#KrWA`i(^Q| doa6)rULenafl;h;)fw97*a7OIYC53K!inzr>n`SsmY<~U_d}bfPjaA1y>gb7ZWF&qs9VeW`>R0oZ5*i RzOsW1@^tlcS?83{1OPg!9~S@s literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setColorMask-1.png b/testing/output/expected/love.test.graphics.setColorMask-1.png new file mode 100644 index 0000000000000000000000000000000000000000..254f834f807f381374e51f249e36e74ffcdd595f GIT binary patch literal 99 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|WIbIRLo9le v|NNi-(4LvKp;PGWVzwSBgRBDyMhpx|vzcWNpM1UxsF1wh4Ffx&UH5J*Da)5S5Q zVovgg|K~USw?Evso9A}&L5>|Gz_k!R?dO&7D4LHh{Evy85}Sb4q9e0Pq?g Ai2wiq literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setLineJoin-1.png b/testing/output/expected/love.test.graphics.setLineJoin-1.png new file mode 100644 index 0000000000000000000000000000000000000000..76397bdbe9e4cb23caefb88287bf919b8d6d9da6 GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9JOMr-uK$4y28RD2>OVu!Q9B^5 z>FMGaQZXkvA%TN8H6cNOH)%)oHszVuc`#g7d@ OO$?r{elF{r5}E*@EFo6_ literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setLineStyle-1.png b/testing/output/expected/love.test.graphics.setLineStyle-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9df1b38176469edd331bb69b5c15855e6b536363 GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|uK$4y28K-x3_Rb?e+9B6 vJY5_^D&{07Ff;}zI4FfNGPXEOR`6k9s9i2LRov399HiXS)z4*}Q$iB}1wt1E literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setLineWidth-1.png b/testing/output/expected/love.test.graphics.setLineWidth-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ce30d2cfe919586b3897bd2956f0f14623c430a8 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9JOMr-uK$4y28RD2>OVu!Q9B^5 z>gnPbQZXkvAwhsQl|gu+qC?WvRVz=pWQa`o@&CUzo1j$xTn2^(cNGKgcU4XSY4>#X Kb6Mw<&;$TWV<9O3 literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setScissor-1.png b/testing/output/expected/love.test.graphics.setScissor-1.png new file mode 100644 index 0000000000000000000000000000000000000000..202f26d04f4fd146dd215e9d609c5d286939c111 GIT binary patch literal 89 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9>wh4Ffx&UH5J-a0)5S5Q hVoq|xkMj;(Oblhm`9D5sSG)mI;pyt_~=6Vm_y literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setShader-1.png b/testing/output/expected/love.test.graphics.setShader-1.png new file mode 100644 index 0000000000000000000000000000000000000000..315c7a936f3dc201ea118e957e50a50e5f26b1f7 GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5X>;L}@UB|w-0=Yb%E{-7; dbCMGjc!4|v21c>YSr>sU22WQ%mvv4FO#qBk5)l9Z literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setStencilTest-1.png b/testing/output/expected/love.test.graphics.setStencilTest-1.png new file mode 100644 index 0000000000000000000000000000000000000000..773650483e3fc116451895a7d9a769351601bfcc GIT binary patch literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9E0F%rz##p<7bK$K>Eakt zF()~Jf%zFT&mVb-C-n^z{>rm7bucV#;5xv-pf{E0tZnl~U!YnBPgg&ebxsLQ0AyGi A5&!@I literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setWireframe-1.png b/testing/output/expected/love.test.graphics.setWireframe-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ceea66531e124bd8a373e27a938f70537b8a89c5 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9E0F&GpP}P+K>(0t>gnPb zQZa}3)J9&Qa+izqwMD#?BaR5RUg9vDC=pZfm04rD>N1H%-D;~o9OO-(Q*flQ_J8dX XTXsI7l5JOj1~7QK`njxgN@xNAeg7o< literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.shear-1.png b/testing/output/expected/love.test.graphics.shear-1.png new file mode 100644 index 0000000000000000000000000000000000000000..36a779c57416abdc435ab92f97dcd8a83d87af63 GIT binary patch literal 98 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9E0F%rz##p<7bGI?>Eakt rF(-LNLc)aPgoONrgqi~mEDQ{Rtc?GiTT}l5l`wd^`njxgN@xNAg6J0G literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.shear-2.png b/testing/output/expected/love.test.graphics.shear-2.png new file mode 100644 index 0000000000000000000000000000000000000000..3d1873ea5604756786337a8e5c2f1541c57b4f8d GIT binary patch literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9E0F%rz##p<7bGI(>Eakt uF()}8At8fdF>}Hc1~;|@6$ZBz3=GW|m=BhJINbwh4Ffx&UH5J*DE)5S5Q mVovgkf9F5Qb1p126kxbAN$%#^nTJe3syto&T-G@yGywn}=@wi7 literal 0 HcmV?d00001 diff --git a/testing/output/expected/notes.txt b/testing/output/expected/notes.txt new file mode 100644 index 000000000..25b54bba5 --- /dev/null +++ b/testing/output/expected/notes.txt @@ -0,0 +1,2 @@ +# Expected Graphics Output +The images expected by the tests \ No newline at end of file diff --git a/testing/output/readme.md b/testing/output/notes.txt similarity index 100% rename from testing/output/readme.md rename to testing/output/notes.txt diff --git a/testing/resources/loveinv.png b/testing/resources/loveinv.png new file mode 100644 index 0000000000000000000000000000000000000000..7be943a20fb70f11f5969fa6548bf70cc90608dc GIT binary patch literal 680 zcmV;Z0$2TsP)Px%Vo5|nRCt{2o7+*tFc3vAv;sfS4h*3LsDmP)1i}Cf&9(vG=YF z@%7T0>Fr z7M27`Bhl~{h6Hy5z2Gfg3CEs;d&2|3`_;Yc9GV5p0p8+~&{RHifxmlw+j@QebX(0+ zT>*1}A4^LmR2gf5e_owz{=Qs)(T+*4{xCI_Q2fPO_#s4^DX5xb_6Y#WB@}&$32#Y( zYL3alTS_Ekzo3A(7*NeIAFGF&)5%KM`=Juv6Q+d859SJQVM!Pr2IoA~wPtFF+_B;v z>LOEH1;B14Y*oO2yz*(%N^so_{fBG>9KzMN469(NfZiw2I|nadYe?|?ADH_Op<#wY z;ZgzV8-Jk+SXUnyseoQfRU$HWKR~+~vZ$+|_3BUE3{h`~Eh-6Yct9{AVqr^AzyqQw zF$+tA3LX$nidwu9l<8FF4Q!4>;Ecn1otzc3R;9!U75J^LcMP@BnFvOfLyuc!0P_ zDp~>q9w0B1i;}>C2LuZx)e@NSfM}_#N&*`m5H6NxOHjZA;^p!z2`YFXV8eu0f)XAG z+A`BBK@ATCZkno<5CIPaZ<{NX5Cso(*f^P!5D5=-+&Y_zhz4J> Date: Sat, 14 Oct 2023 18:18:53 +0100 Subject: [PATCH 19/54] finished a bunch of modules - finished audio module - finished data module - finished filesystem module - finished font module (note: glphy test fails, but seems to be a 12.0 issue) - finished image module - finished maths module - finished sound module - finished thread module - finished video module - fixed pcall error not showing in results for invalid test code --- .github/workflows/main.yml | 177 ++- testing/classes/TestMethod.lua | 65 +- testing/classes/TestSuite.lua | 11 +- testing/examples/lovetest_runAllTests.html | 2 +- testing/examples/lovetest_runAllTests.md | 38 +- testing/examples/lovetest_runAllTests.xml | 1239 +++++++++++--------- testing/main.lua | 28 +- testing/readme.md | 117 +- testing/resources/alsoft.conf | 4 + testing/resources/clickmono.ogg | Bin 0 -> 3883 bytes testing/tests/audio.lua | 170 ++- testing/tests/data.lua | 86 +- testing/tests/event.lua | 9 +- testing/tests/filesystem.lua | 104 +- testing/tests/font.lua | 74 +- testing/tests/graphics.lua | 217 +++- testing/tests/image.lua | 79 +- testing/tests/math.lua | 156 ++- testing/tests/objects.lua | 411 ------- testing/tests/physics.lua | 88 +- testing/tests/sound.lua | 70 +- testing/tests/system.lua | 7 + testing/tests/thread.lua | 108 +- testing/tests/timer.lua | 7 + testing/tests/video.lua | 36 +- testing/tests/window.lua | 86 +- testing/todo.md | 43 +- 27 files changed, 2169 insertions(+), 1263 deletions(-) create mode 100644 testing/resources/alsoft.conf create mode 100644 testing/resources/clickmono.ogg delete mode 100644 testing/tests/objects.lua diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5229bdaf8..9ce1d327b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,10 @@ on: [push, pull_request] jobs: linux-os: - runs-on: ubuntu-20.04 - timeout-minutes: 60 + runs-on: ubuntu-22.04 + env: + ALSOFT_CONF: resources/alsoft.conf + DISPLAY: :99 steps: - name: Update APT run: sudo apt-get update @@ -16,7 +18,9 @@ jobs: libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ - libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev + libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ + libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ + vulkan-validationlayers - name: Checkout love-appimage-source uses: actions/checkout@v3 with: @@ -55,17 +59,82 @@ jobs: chmod a+x love-${{ github.sha }}.AppImage echo "ready to run" ls - - name: Run All Tests + - name: Start xvfb and openbox + run: | + echo "Starting XVFB on $DISPLAY" + Xvfb $DISPLAY -screen 0, 360x240x24 & + echo "XVFBPID=$!" >> $GITHUB_ENV + # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) + sleep 3 + openbox & + echo "OPENBOXPID=$!" >> $GITHUB_ENV + # linux opengl tests + - name: Run All Tests (opengl) run: xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua - - name: Love Test Report + - name: Love Test Report (opengl) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-opengl + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengl) + run: | + 7z a -tzip test-output-linux-opengl.zip testing/output/ + - name: Artifact Test Output (opengl) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-opengl + path: test-output-linux-opengl.zip + # linux opengles tests + - name: Run Test Suite (opengles) + run: | + export LOVE_GRAPHICS_USE_OPENGLES=1 + xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua + - name: Love Test Report (opengles) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-opengles + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengles) + run: | + 7z a -tzip test-output-linux-opengles.zip testing/output/ + - name: Artifact Test Output (opengles) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-opengles + path: test-output-linux-opengles.zip + # linux vulkan tests + - name: Run Test Suite (vulkan) + run: | + export LOVE_GRAPHICS_DEBUG=1 + xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua --runAllTests --renderers vulkan + - name: Love Test Report (vulkan) uses: ellraiser/love-test-report@main with: name: Love Testsuite Linux - title: linux-test-report + title: test-report-linux-vulkan path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (vulkan) + run: | + 7z a -tzip test-output-linux-vulkan.zip testing/output/ + - name: Artifact Test Output (vulkan) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-vulkan + path: test-output-linux-vulkan.zip + - name: Stop xvfb and openbox + # should always stop xvfb and openbox even if other steps failed + if: always() + run: | + kill $XVFBPID + kill $OPENBOXPID windows-os: runs-on: windows-latest - timeout-minutes: 60 + env: + ALSOFT_CONF: resources/alsoft.conf + VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json + VULKAN_SDK: C:/VulkanSDK/1.3.231.1 strategy: matrix: platform: [Win32, x64, ARM64] @@ -220,19 +289,6 @@ jobs: with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb - - name: Install Scream - shell: powershell - run: | - Start-Service audio* - Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip - Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream - $cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate - $store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine") - $store.Open("ReadWrite") - $store.Add($cert) - $store.Close() - cd C:\Scream\Install\driver - C:\Scream\Install\helpers\devcon install Scream.inf *Scream - name: Install Mesa run: | curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z @@ -241,21 +297,78 @@ jobs: - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - - name: Run All Tests + - name: Run Tests (opengl) if: steps.vars.outputs.arch != 'ARM64' run: | dir powershell.exe ./install/lovec.exe ./testing/main.lua - - name: Love Test Report + # windows opengl test + - name: Love Test Report (opengl) if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: - name: Love Testsuite Windows - title: windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-test-report + name: Love Testsuite Windows (opengl) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengl) + run: | + 7z a -tzip test-output-windows-opengl.zip testing/output/ + - name: Artifact Test Output (opengl) + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-opengl + path: test-output-windows-opengl.zip + # windows opengles test + - name: Run Tests (opengles) + run: | + $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 + powershell.exe ./install/lovec.exe ./testing/main.lua + - name: Love Test Report (opengles) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (opengles) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengles) + run: | + 7z a -tzip test-output-windows-opengles.zip testing/output/ + - name: Artifact Test Output (opengles) + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-opengles + path: test-output-windows-opengles.zip + - name: Install Vulkan + run: | + curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe + ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma + curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip + 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" + reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 + powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary + # windows vulkan tests + - name: Run Tests (vulkan) + run: | + $ENV:LOVE_GRAPHICS_DEBUG=1 + powershell.exe ./install/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan + - name: Love Test Report (vulkan) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (vulkan) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (vulkan) + run: | + 7z a -tzip test-output-windows-vulkan.zip testing/output + - name: Artifact Test Output (vulkan) + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-vulkan + path: test-output-windows-vulkan.zip macOS: runs-on: macos-latest - timeout-minutes: 60 steps: - name: Checkout uses: actions/checkout@v3 @@ -282,17 +395,25 @@ jobs: with: name: love-macos path: love-macos.zip - - name: Run All Tests + # macos opengl tests + - name: Run Tests run: love-macos/love.app/Contents/MacOS/love testing/main.lua - name: Love Test Report uses: ellraiser/love-test-report@main with: name: Love Testsuite MacOS - title: macos-test-report + title: test-report-macos path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output + run: | + 7z a -tzip test-output-macos-opengl.zip testing/output/ + - name: Artifact Test Output + uses: actions/upload-artifact@v3 + with: + name: test-output-macos-opengl + path: test-output-macos-opengl.zip iOS-Simulator: runs-on: macos-latest - timeout-minutes: 60 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index ad3a742e6..4c7705693 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -41,7 +41,8 @@ TestMethod = { }, imgs = 1, delay = 0, - delayed = false + delayed = false, + store = {} } setmetatable(test, self) self.__index = self @@ -58,11 +59,11 @@ TestMethod = { assertEquals = function(self, expected, actual, label) self.count = self.count + 1 table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = expected == actual, message = 'expected \'' .. tostring(expected) .. '\' got \'' .. tostring(actual) .. '\'', - test = label + test = label or 'no label given' }) end, @@ -109,11 +110,11 @@ TestMethod = { assertNotEquals = function(self, expected, actual, label) self.count = self.count + 1 table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = expected ~= actual, message = 'avoiding \'' .. tostring(expected) .. '\' got \'' .. tostring(actual) .. '\'', - test = label + test = label or 'no label given' }) end, @@ -128,11 +129,11 @@ TestMethod = { assertRange = function(self, actual, min, max, label) self.count = self.count + 1 table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = actual >= min and actual <= max, message = 'value \'' .. tostring(actual) .. '\' out of range \'' .. tostring(min) .. '-' .. tostring(max) .. '\'', - test = label + test = label or 'no label given' }) end, @@ -150,11 +151,11 @@ TestMethod = { if list[l] == actual then found = true end; end table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = found == true, message = 'value \'' .. tostring(actual) .. '\' not found in \'' .. table.concat(list, ',') .. '\'', - test = label + test = label or 'no label given' }) end, @@ -172,11 +173,11 @@ TestMethod = { passing = actual >= target end table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = passing, message = 'value \'' .. tostring(actual) .. '\' not >= \'' .. tostring(target) .. '\'', - test = label + test = label or 'no label given' }) end, @@ -194,11 +195,11 @@ TestMethod = { passing = actual <= target end table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = passing, message = 'value \'' .. tostring(actual) .. '\' not <= \'' .. tostring(target) .. '\'', - test = label + test = label or 'no label given' }) end, @@ -206,7 +207,7 @@ TestMethod = { -- @method - TestMethod:assertObject() -- @desc - used to check a table is a love object, this runs 3 seperate -- tests to check table has the basic properties of an object - -- @note - actual object functionality tests are done in the objects module + -- @note - actual object functionality tests have their own methods -- @param {table} obj - table to check is a valid love object -- @return {nil} assertObject = function(self, obj) @@ -218,6 +219,29 @@ TestMethod = { end, + -- @method - TestMethod:assertCoords() + -- @desc - used to check a pair of values (usually coordinates) + -- @param {table} obj - table to check is a valid love object + -- @return {nil} + assertCoords = function(self, expected, actual, label) + self.count = self.count + 1 + local passing = false + if expected ~= nil and actual ~= nil then + if expected[1] == actual[1] and expected[2] == actual[2] then + passing = true + end + end + table.insert(self.asserts, { + key = 'assert ' .. tostring(self.count), + passed = passing, + message = 'expected \'' .. tostring(expected[1]) .. 'x,' .. + tostring(expected[2]) .. 'y\' got \'' .. + tostring(actual[1]) .. 'x,' .. tostring(actual[2]) .. 'y\'', + test = label or 'no label given' + }) + end, + + -- @method - TestMethod:assertNotNil() -- @desc - quick assert for value not nil -- @param {any} value - value to check not nil @@ -226,7 +250,7 @@ TestMethod = { self:assertNotEquals(nil, value, 'check not nil') if err ~= nil then table.insert(self.asserts, { - key = 'assert #' .. tostring(self.count), + key = 'assert ' .. tostring(self.count), passed = false, message = err, test = 'assert not nil catch' @@ -235,6 +259,10 @@ TestMethod = { end, + -- @method - TestMethod:exportImg() + -- @desc - used to export actual test img results to compare to the expected + -- @param {table} imgdata - imgdata to save as a png + -- @return {nil} exportImg = function(self, imgdata) local path = 'tempoutput/actual/love.test.graphics.' .. self.method .. '-' .. tostring(self.imgs) .. '.png' @@ -320,12 +348,17 @@ TestMethod = { if failure['test'] ~= nil then key = key .. ' [' .. failure['test'] .. ']' end + local msg = failure['message'] + if self.fatal ~= '' then + key = 'code' + msg = self.fatal + end self.result = { total = total, result = 'FAIL', passed = false, key = key, - message = failure['message'] + message = msg } end end diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index cbe171c31..4ac04a4be 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -35,7 +35,6 @@ TestSuite = { joystick = {}, math = {}, mouse = {}, - objects = {}, -- special for all object class contructor tests physics = {}, sound = {}, system = {}, @@ -76,7 +75,7 @@ TestSuite = { TextRun:set('love.' .. self.module.module .. '.' .. method) -- check method exists in love first - if self.module.module ~= 'objects' and (love[self.module.module] == nil or love[self.module.module][method] == nil) then + if love[self.module.module] == nil then local tested = 'love.' .. self.module.module .. '.' .. method .. '()' local matching = string.sub(self.module.spacer, string.len(tested), 40) self.module:log(self.module.colors['FAIL'], @@ -87,7 +86,7 @@ TestSuite = { else local ok, chunk, err = pcall(self[self.module.module][method], self.test) if ok == false then - print("FATAL", chunk, err) + self.test.passed = false self.test.fatal = tostring(chunk) .. tostring(err) end end @@ -105,7 +104,7 @@ TestSuite = { if self.delayed.delay <= 0 then local ok, chunk, err = pcall(self[self.module.module][self.delayed.method], self.test) if ok == false then - print("FATAL", chunk, err) + self.test.passed = false self.test.fatal = tostring(chunk) .. tostring(err) end self.delayed = nil @@ -115,7 +114,7 @@ TestSuite = { -- now we're all done evaluate the test local ok, chunk, err = pcall(self.test.evaluateTest, self.test) if ok == false then - print("FATAL", chunk, err) + self.test.passed = false self.test.fatal = tostring(chunk) .. tostring(err) end -- save having to :release() anything we made in the last test @@ -169,7 +168,7 @@ TestSuite = { tostring(self.totals[1]) .. '** passed, **' .. tostring(self.totals[2]) .. '** failed, and **' .. tostring(self.totals[3]) .. '** skipped\n\n### Report\n' .. - '| Module | Passed | Failed | Skipped | Time |\n' .. + '| Module | Pass | Fail | Skip | Time |\n' .. '| --------------------- | ------ | ------ | ------- | ------ |\n' .. self.mdrows .. '\n\n### Failures\n' .. self.mdfailures diff --git a/testing/examples/lovetest_runAllTests.html b/testing/examples/lovetest_runAllTests.html index ac9b12d58..641d05999 100644 --- a/testing/examples/lovetest_runAllTests.html +++ b/testing/examples/lovetest_runAllTests.html @@ -1 +1 @@ -

🔴 love.test

  • 🟢 226 Tests
  • 🔴 2 Failures
  • 🟡 43 Skipped
  • 7.563s


🟢 love.audio

  • 🟢 26 Tests
  • 🔴 0 Failures
  • 🟡 0 Skipped
  • 0.006s


    • MethodTimeDetails
      🟢getActiveEffects0.000s
      🟢getActiveSourceCount0.001s
      🟢getDistanceModel0.000s
      🟢getDopplerScale0.000s
      🟢getEffect0.000s
      🟢getMaxSceneEffects0.000s
      🟢getMaxSourceEffects0.000s
      🟢getOrientation0.000s
      🟢getPosition0.000s
      🟢getRecordingDevices0.000s
      🟢getVelocity0.000s
      🟢getVolume0.000s
      🟢isEffectsSupported0.000s
      🟢newQueueableSource0.000s
      🟢newSource0.001s
      🟢pause0.001s
      🟢play0.001s
      🟢setDistanceModel0.000s
      🟢setDopplerScale0.000s
      🟢setEffect0.000s
      🟢setMixWithSystem0.000s
      🟢setOrientation0.000s
      🟢setPosition0.000s
      🟢setVelocity0.000s
      🟢setVolume0.000s
      🟢stop0.001s

      🟢 love.data

      • 🟢 7 Tests
      • 🔴 0 Failures
      • 🟡 3 Skipped
      • 0.001s


        • MethodTimeDetails
          🟢compress0.000s
          🟢decode0.000s
          🟢decompress0.000s
          🟢encode0.000s
          🟡getPackedSize0.000stest method needs writing
          🟢hash0.000s
          🟢newByteData0.000s
          🟢newDataView0.000s
          🟡pack0.000stest method needs writing
          🟡unpack0.000stest method needs writing

          🟢 love.event

          • 🟢 4 Tests
          • 🔴 0 Failures
          • 🟡 2 Skipped
          • 0.000s


            • MethodTimeDetails
              🟢clear0.000s
              🟢poll0.000s
              🟡pump0.000snot sure can be tested as used internally
              🟢push0.000s
              🟢quit0.000s
              🟡wait0.000stest method needs writing

              🟢 love.filesystem

              • 🟢 27 Tests
              • 🔴 0 Failures
              • 🟡 2 Skipped
              • 0.018s


                • MethodTimeDetails
                  🟢append0.002s
                  🟢areSymlinksEnabled0.000s
                  🟢createDirectory0.001s
                  🟢getAppdataDirectory0.000s
                  🟢getCRequirePath0.000s
                  🟢getDirectoryItems0.002s
                  🟢getIdentity0.000s
                  🟢getInfo0.002s
                  🟢getRealDirectory0.001s
                  🟢getRequirePath0.000s
                  🟢getSaveDirectory0.000s
                  🟡getSource0.000snot sure can be tested as used internally
                  🟢getSourceBaseDirectory0.000s
                  🟢getUserDirectory0.000s
                  🟢getWorkingDirectory0.000s
                  🟢isFused0.000s
                  🟢lines0.001s
                  🟢load0.001s
                  🟢mount0.002s
                  🟢newFileData0.000s
                  🟢openFile0.000s
                  🟢read0.000s
                  🟢remove0.002s
                  🟢setCRequirePath0.000s
                  🟢setIdentity0.000s
                  🟢setRequirePath0.000s
                  🟡setSource0.000snot sure can be tested as used internally
                  🟢unmount0.002s
                  🟢write0.002s

                  🟢 love.font

                  • 🟢 4 Tests
                  • 🔴 0 Failures
                  • 🟡 1 Skipped
                  • 0.002s


                    • MethodTimeDetails
                      🟡newBMFontRasterizer0.000swiki and source dont match, not sure expected usage
                      🟢newGlyphData0.001s
                      🟢newImageRasterizer0.000s
                      🟢newRasterizer0.000s
                      🟢newTrueTypeRasterizer0.000s

                      🟢 love.graphics

                      • 🟢 65 Tests
                      • 🔴 0 Failures
                      • 🟡 31 Skipped
                      • 0.079s


                        • MethodTimeDetails
                          🟢applyTransform0.002s
                          🟡arc0.000stest method needs writing
                          🟡captureScreenshot0.000scant test this worked (easily)
                          🟡circle0.000stest method needs writing
                          🟡clear0.000stest method needs writing
                          🟡discard0.000stest method needs writing
                          🟡draw0.000stest method needs writing
                          🟡drawInstanced0.000stest method needs writing
                          🟡drawLayer0.000stest method needs writing
                          🟡ellipse0.000stest method needs writing
                          🟡flushBatch0.000stest method needs writing
                          🟢getBackgroundColor0.000s
                          🟢getBlendMode0.000s
                          🟢getCanvas0.000s
                          🟢getColor0.000s
                          🟢getColorMask0.000s
                          🟢getDPIScale0.000s
                          🟢getDefaultFilter0.000s
                          🟢getDepthMode0.000s
                          🟢getDimensions0.000s
                          🟢getFont0.001s
                          🟢getFrontFaceWinding0.000s
                          🟢getHeight0.000s
                          🟢getLineJoin0.000s
                          🟢getLineStyle0.000s
                          🟢getLineWidth0.000s
                          🟢getMeshCullMode0.000s
                          🟢getPixelDimensions0.000s
                          🟢getPixelHeight0.000s
                          🟢getPixelWidth0.000s
                          🟢getPointSize0.000s
                          🟢getRendererInfo0.000s
                          🟢getScissor0.000s
                          🟢getShader0.000s
                          🟢getStackDepth0.000s
                          🟢getStats0.000s
                          🟢getStencilMode0.000s
                          🟢getSupported0.000s
                          🟢getSystemLimits0.000s
                          🟢getTextureFormats0.001s
                          🟢getTextureTypes0.000s
                          🟢getWidth0.000s
                          🟢intersectScissor0.003s
                          🟢inverseTransformPoint0.000s
                          🟢isActive0.000s
                          🟢isGammaCorrect0.000s
                          🟢isWireframe0.000s
                          🟡line0.000stest method needs writing
                          🟢newArrayImage0.002s
                          🟢newCanvas0.001s
                          🟢newCubeImage0.003s
                          🟢newFont0.001s
                          🟢newImage0.001s
                          🟢newImageFont0.001s
                          🟢newMesh0.000s
                          🟢newParticleSystem0.002s
                          🟢newQuad0.002s
                          🟢newShader0.015s
                          🟢newSpriteBatch0.001s
                          🟢newTextBatch0.002s
                          🟢newVideo0.004s
                          🟢newVolumeImage0.001s
                          🟢origin0.000s
                          🟡points0.000stest method needs writing
                          🟡polygon0.000stest method needs writing
                          🟢pop0.001s
                          🟡present0.000stest method needs writing
                          🟡print0.000stest method needs writing
                          🟡printf0.000stest method needs writing
                          🟢push0.002s
                          🟢rectangle0.007s
                          🟢replaceTransform0.002s
                          🟢reset0.001s
                          🟢rotate0.004s
                          🟢scale0.002s
                          🟢setBackgroundColor0.000s
                          🟡setBlendMode0.001stest method needs writing
                          🟡setCanvas0.000stest method needs writing
                          🟡setColor0.000stest method needs writing
                          🟡setColorMask0.000stest method needs writing
                          🟢setDefaultFilter0.000s
                          🟡setDepthMode0.000stest method needs writing
                          🟡setFont0.000stest method needs writing
                          🟡setFrontFaceWinding0.000stest method needs writing
                          🟡setLineJoin0.000stest method needs writing
                          🟡setLineStyle0.000stest method needs writing
                          🟡setLineWidth0.000stest method needs writing
                          🟡setMeshCullMode0.000stest method needs writing
                          🟡setScissor0.000stest method needs writing
                          🟡setShader0.000stest method needs writing
                          🟡setStencilMode0.000stest method needs writing
                          🟡setWireframe0.000stest method needs writing
                          🟢shear0.002s
                          🟢transformPoint0.000s
                          🟢translate0.001s
                          🟢validateShader0.010s

                          🟢 love.image

                          • 🟢 3 Tests
                          • 🔴 0 Failures
                          • 🟡 0 Skipped
                          • 0.002s


                            • MethodTimeDetails
                              🟢isCompressed0.001s
                              🟢newCompressedData0.001s
                              🟢newImageData0.000s

                              🟢 love.math

                              • 🟢 17 Tests
                              • 🔴 0 Failures
                              • 🟡 0 Skipped
                              • 0.003s


                                • MethodTimeDetails
                                  🟢colorFromBytes0.000s
                                  🟢colorToBytes0.001s
                                  🟢gammaToLinear0.000s
                                  🟢getRandomSeed0.000s
                                  🟢getRandomState0.000s
                                  🟢isConvex0.000s
                                  🟢linearToGamma0.000s
                                  🟢newBezierCurve0.000s
                                  🟢newRandomGenerator0.000s
                                  🟢newTransform0.000s
                                  🟢perlinNoise0.000s
                                  🟢random0.000s
                                  🟢randomNormal0.000s
                                  🟢setRandomSeed0.000s
                                  🟢setRandomState0.000s
                                  🟢simplexNoise0.000s
                                  🟢triangulate0.000s

                                  🟢 love.objects

                                  • 🟢 1 Tests
                                  • 🔴 0 Failures
                                  • 🟡 0 Skipped
                                  • 0.008s


                                    • MethodTimeDetails
                                      🟢File0.008s

                                      🟢 love.physics

                                      • 🟢 22 Tests
                                      • 🔴 0 Failures
                                      • 🟡 0 Skipped
                                      • 0.005s


                                        • MethodTimeDetails
                                          🟢getDistance0.000s
                                          🟢getMeter0.000s
                                          🟢newBody0.000s
                                          🟢newChainShape0.000s
                                          🟢newCircleShape0.000s
                                          🟢newDistanceJoint0.000s
                                          🟢newEdgeShape0.000s
                                          🟢newFixture0.000s
                                          🟢newFrictionJoint0.000s
                                          🟢newGearJoint0.000s
                                          🟢newMotorJoint0.000s
                                          🟢newMouseJoint0.000s
                                          🟢newPolygonShape0.000s
                                          🟢newPrismaticJoint0.000s
                                          🟢newPulleyJoint0.000s
                                          🟢newRectangleShape0.001s
                                          🟢newRevoluteJoint0.000s
                                          🟢newRopeJoint0.000s
                                          🟢newWeldJoint0.000s
                                          🟢newWheelJoint0.001s
                                          🟢newWorld0.000s
                                          🟢setMeter0.000s

                                          🟢 love.sound

                                          • 🟢 2 Tests
                                          • 🔴 0 Failures
                                          • 🟡 0 Skipped
                                          • 0.004s


                                            • MethodTimeDetails
                                              🟢newDecoder0.001s
                                              🟢newSoundData0.003s

                                              🟢 love.system

                                              • 🟢 6 Tests
                                              • 🔴 0 Failures
                                              • 🟡 2 Skipped
                                              • 0.007s


                                                • MethodTimeDetails
                                                  🟢getClipboardText0.006s
                                                  🟢getOS0.000s
                                                  🟢getPowerInfo0.000s
                                                  🟢getProcessorCount0.000s
                                                  🟢hasBackgroundMusic0.000s
                                                  🟡openURL0.000scant test this worked
                                                  🟢setClipboardText0.001s
                                                  🟡vibrate0.000scant test this worked

                                                  🟢 love.thread

                                                  • 🟢 3 Tests
                                                  • 🔴 0 Failures
                                                  • 🟡 0 Skipped
                                                  • 0.002s


                                                    • MethodTimeDetails
                                                      🟢getChannel0.000s
                                                      🟢newChannel0.000s
                                                      🟢newThread0.001s

                                                      🟢 love.timer

                                                      • 🟢 6 Tests
                                                      • 🔴 0 Failures
                                                      • 🟡 0 Skipped
                                                      • 2.002s


                                                        • MethodTimeDetails
                                                          🟢getAverageDelta0.000s
                                                          🟢getDelta0.000s
                                                          🟢getFPS0.000s
                                                          🟢getTime1.001s
                                                          🟢sleep1.001s
                                                          🟢step0.000s

                                                          🟢 love.video

                                                          • 🟢 1 Tests
                                                          • 🔴 0 Failures
                                                          • 🟡 0 Skipped
                                                          • 0.005s


                                                            • MethodTimeDetails
                                                              🟢newVideoStream0.005s

                                                              🔴 love.window

                                                              • 🟢 32 Tests
                                                              • 🔴 2 Failures
                                                              • 🟡 2 Skipped
                                                              • 5.419s


                                                                • MethodTimeDetails
                                                                  🟢close0.037s
                                                                  🟢fromPixels0.000s
                                                                  🟢getDPIScale0.000s
                                                                  🟢getDesktopDimensions0.000s
                                                                  🟢getDisplayCount0.000s
                                                                  🟢getDisplayName0.000s
                                                                  🟢getDisplayOrientation0.000s
                                                                  🟢getFullscreen1.347s
                                                                  🟢getFullscreenModes0.001s
                                                                  🟢getIcon0.004s
                                                                  🟢getMode0.000s
                                                                  🟢getPosition0.001s
                                                                  🟢getSafeArea0.000s
                                                                  🟢getTitle0.001s
                                                                  🟢getVSync0.000s
                                                                  🟢hasFocus0.000s
                                                                  🟢hasMouseFocus0.000s
                                                                  🟢isDisplaySleepEnabled0.000s
                                                                  🔴isMaximized0.640sassert #2 [check window not maximized] expected 'true' got 'false'
                                                                  🟢isMinimized0.645s
                                                                  🟢isOpen0.036s
                                                                  🟢isVisible0.031s
                                                                  🔴maximize0.000sassert #1 [check window maximized] expected 'true' got 'false'
                                                                  🟢minimize0.646s
                                                                  🟡requestAttention0.000scant test this worked
                                                                  🟢restore0.642s
                                                                  🟢setDisplaySleepEnabled0.000s
                                                                  🟢setFullscreen1.370s
                                                                  🟢setIcon0.002s
                                                                  🟢setMode0.008s
                                                                  🟢setPosition0.001s
                                                                  🟢setTitle0.000s
                                                                  🟢setVSync0.000s
                                                                  🟡showMessageBox0.000scant test this worked
                                                                  🟢toPixels0.000s
                                                                  🟢updateMode0.006s
\ No newline at end of file +

🔴 love.test

  • 🟢 254 Tests
  • 🔴 1 Failures
  • 🟡 50 Skipped
  • 12.195s


🟢 love.audio

  • 🟢 26 Tests
  • 🔴 0 Failures
  • 🟡 2 Skipped
  • 0.473s


    • MethodTimeDetails
      🟡RecordingDevice0.024stest class needs writing
      🟡Source0.017stest class needs writing
      🟢getActiveEffects0.016s
      🟢getActiveSourceCount0.016s
      🟢getDistanceModel0.017s
      🟢getDopplerScale0.016s
      🟢getEffect0.016s
      🟢getMaxSceneEffects0.017s
      🟢getMaxSourceEffects0.015s
      🟢getOrientation0.017s
      🟢getPosition0.017s
      🟢getRecordingDevices0.017s
      🟢getVelocity0.016s
      🟢getVolume0.017s
      🟢isEffectsSupported0.016s
      🟢newQueueableSource0.015s
      🟢newSource0.014s
      🟢pause0.016s
      🟢play0.017s
      🟢setDistanceModel0.019s
      🟢setDopplerScale0.017s
      🟢setEffect0.017s
      🟢setMixWithSystem0.017s
      🟢setOrientation0.017s
      🟢setPosition0.018s
      🟢setVelocity0.017s
      🟢setVolume0.016s
      🟢stop0.018s

      🟢 love.data

      • 🟢 7 Tests
      • 🔴 0 Failures
      • 🟡 5 Skipped
      • 0.212s


        • MethodTimeDetails
          🟡ByteData0.016stest class needs writing
          🟡CompressedData0.017stest class needs writing
          🟢compress0.017s
          🟢decode0.018s
          🟢decompress0.018s
          🟢encode0.019s
          🟡getPackedSize0.019stest class needs writing
          🟢hash0.017s
          🟢newByteData0.017s
          🟢newDataView0.017s
          🟡pack0.018stest class needs writing
          🟡unpack0.018stest class needs writing

          🟢 love.event

          • 🟢 4 Tests
          • 🔴 0 Failures
          • 🟡 2 Skipped
          • 0.108s


            • MethodTimeDetails
              🟢clear0.017s
              🟢poll0.017s
              🟡pump0.019snot sure can be tested as used internally
              🟢push0.018s
              🟢quit0.019s
              🟡wait0.018stest class needs writing

              🟢 love.filesystem

              • 🟢 28 Tests
              • 🔴 0 Failures
              • 🟡 3 Skipped
              • 0.556s


                • MethodTimeDetails
                  🟢File0.017s
                  🟡FileData0.019stest class needs writing
                  🟢append0.019s
                  🟢areSymlinksEnabled0.017s
                  🟢createDirectory0.017s
                  🟢getAppdataDirectory0.018s
                  🟢getCRequirePath0.017s
                  🟢getDirectoryItems0.018s
                  🟢getIdentity0.019s
                  🟢getInfo0.019s
                  🟢getRealDirectory0.018s
                  🟢getRequirePath0.018s
                  🟢getSaveDirectory0.018s
                  🟡getSource0.018snot sure can be tested as used internally
                  🟢getSourceBaseDirectory0.018s
                  🟢getUserDirectory0.019s
                  🟢getWorkingDirectory0.019s
                  🟢isFused0.017s
                  🟢lines0.018s
                  🟢load0.016s
                  🟢mount0.019s
                  🟢newFileData0.018s
                  🟢openFile0.019s
                  🟢read0.017s
                  🟢remove0.018s
                  🟢setCRequirePath0.018s
                  🟢setIdentity0.018s
                  🟢setRequirePath0.018s
                  🟡setSource0.018snot sure can be tested as used internally
                  🟢unmount0.018s
                  🟢write0.019s

                  🟢 love.font

                  • 🟢 4 Tests
                  • 🔴 0 Failures
                  • 🟡 3 Skipped
                  • 0.127s


                    • MethodTimeDetails
                      🟡GlyphData0.017stest class needs writing
                      🟡Rasterizer0.018stest class needs writing
                      🟡newBMFontRasterizer0.018swiki and source dont match, not sure expected usage
                      🟢newGlyphData0.020s
                      🟢newImageRasterizer0.020s
                      🟢newRasterizer0.018s
                      🟢newTrueTypeRasterizer0.017s

                      🔴 love.graphics

                      • 🟢 91 Tests
                      • 🔴 1 Failures
                      • 🟡 15 Skipped
                      • 2.091s


                        • MethodTimeDetails
                          🟡Canvas0.016stest class needs writing
                          🟡Font0.017stest class needs writing
                          🟡Image0.019stest class needs writing
                          🟡Mesh0.019stest class needs writing
                          🟡ParticleSystem0.017stest class needs writing
                          🟡Quad0.019stest class needs writing
                          🟡Shader0.018stest class needs writing
                          🟡SpriteBatch0.018stest class needs writing
                          🟡Text0.018stest class needs writing
                          🟡Texture0.018stest class needs writing
                          🟡Video0.019stest class needs writing
                          🟢applyTransform0.018s

                          Expected

                          Actual

                          🟢arc0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢captureScreenshot0.183s
                          🟢circle0.017s

                          Expected

                          Actual

                          🟢clear0.017s

                          Expected

                          Actual

                          🟡discard0.017scant test this worked
                          🟢draw0.018s

                          Expected

                          Actual

                          🟡drawInstanced0.020stest class needs writing
                          🟢drawLayer0.018s

                          Expected

                          Actual

                          🟢ellipse0.018s

                          Expected

                          Actual

                          🟡flushBatch0.018snot sure can be tested as used internally
                          🟢getBackgroundColor0.018s
                          🟢getBlendMode0.018s
                          🟢getCanvas0.018s
                          🟢getColor0.017s
                          🟢getColorMask0.018s
                          🟢getDPIScale0.019s
                          🟢getDefaultFilter0.018s
                          🟢getDepthMode0.018s
                          🟢getDimensions0.017s
                          🟢getFont0.018s
                          🟢getFrontFaceWinding0.019s
                          🟢getHeight0.017s
                          🟢getLineJoin0.018s
                          🟢getLineStyle0.017s
                          🟢getLineWidth0.019s
                          🟢getMeshCullMode0.018s
                          🟢getPixelDimensions0.018s
                          🟢getPixelHeight0.018s
                          🟢getPixelWidth0.018s
                          🟢getPointSize0.019s
                          🟢getRendererInfo0.018s
                          🟢getScissor0.018s
                          🟢getShader0.018s
                          🟢getStackDepth0.018s
                          🟢getStats0.017s
                          🟢getStencilMode0.018s
                          🟢getSupported0.018s
                          🟢getSystemLimits0.019s
                          🟢getTextureFormats0.020s
                          🟢getTextureTypes0.017s
                          🟢getWidth0.018s
                          🟢intersectScissor0.018s

                          Expected

                          Actual

                          🟢inverseTransformPoint0.018s
                          🟢isActive0.018s
                          🟢isGammaCorrect0.019s
                          🟢isWireframe0.017s
                          🟢line0.016s

                          Expected

                          Actual

                          🟢newArrayImage0.018s
                          🟢newCanvas0.019s
                          🟢newCubeImage0.019s
                          🟢newFont0.019s
                          🟢newImage0.018s
                          🟢newImageFont0.017s
                          🟢newMesh0.018s
                          🟢newParticleSystem0.019s
                          🟢newQuad0.018s
                          🟢newShader0.018s
                          🟢newSpriteBatch0.018s
                          🟢newTextBatch0.017s
                          🟢newVideo0.017s
                          🟢newVolumeImage0.018s
                          🟢origin0.018s

                          Expected

                          Actual

                          🟢points0.018s

                          Expected

                          Actual

                          🟢polygon0.018s

                          Expected

                          Actual

                          🟢pop0.019s

                          Expected

                          Actual

                          🟡present0.018stest class needs writing
                          🟢print0.017s

                          Expected

                          Actual

                          🟢printf0.018s

                          Expected

                          Actual

                          🟢push0.018s

                          Expected

                          Actual

                          🟢rectangle0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢replaceTransform0.018s

                          Expected

                          Actual

                          🟢reset0.019s
                          🟢rotate0.019s

                          Expected

                          Actual

                          🟢scale0.017s
                          🟢setBackgroundColor0.017s
                          🟢setBlendMode0.017s

                          Expected

                          Actual

                          🟢setCanvas0.018s

                          Expected

                          Actual

                          🟢setColor0.018s

                          Expected

                          Actual

                          🔴setColorMask0.018sassert #7 [check pixel b for yellow at 0,0(set color mask)] expected '0' got '1'

                          Expected

                          Actual

                          🟢setDefaultFilter0.018s
                          🟢setDepthMode0.018s
                          🟢setFont0.018s

                          Expected

                          Actual

                          🟢setFrontFaceWinding0.019s
                          🟢setLineJoin0.017s

                          Expected

                          Actual

                          🟢setLineStyle0.018s

                          Expected

                          Actual

                          🟢setLineWidth0.018s

                          Expected

                          Actual

                          🟢setMeshCullMode0.018s
                          🟢setScissor0.018s

                          Expected

                          Actual

                          🟢setShader0.018s

                          Expected

                          Actual

                          🟢setStencilTest0.018s

                          Expected

                          Actual

                          🟢setWireframe0.016s

                          Expected

                          Actual

                          🟢shear0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢transformPoint0.018s
                          🟢translate0.019s

                          Expected

                          Actual

                          🟢validateShader0.019s

                          🟢 love.image

                          • 🟢 3 Tests
                          • 🔴 0 Failures
                          • 🟡 2 Skipped
                          • 0.087s


                            • MethodTimeDetails
                              🟡CompressedImageData0.015stest class needs writing
                              🟡ImageData0.018stest class needs writing
                              🟢isCompressed0.019s
                              🟢newCompressedData0.017s
                              🟢newImageData0.018s

                              🟢 love.math

                              • 🟢 17 Tests
                              • 🔴 0 Failures
                              • 🟡 3 Skipped
                              • 0.358s


                                • MethodTimeDetails
                                  🟡BezierCurve0.016stest class needs writing
                                  🟡RandomGenerator0.018stest class needs writing
                                  🟡Transform0.019stest class needs writing
                                  🟢colorFromBytes0.017s
                                  🟢colorToBytes0.018s
                                  🟢gammaToLinear0.017s
                                  🟢getRandomSeed0.018s
                                  🟢getRandomState0.017s
                                  🟢isConvex0.018s
                                  🟢linearToGamma0.017s
                                  🟢newBezierCurve0.018s
                                  🟢newRandomGenerator0.018s
                                  🟢newTransform0.020s
                                  🟢perlinNoise0.018s
                                  🟢random0.019s
                                  🟢randomNormal0.017s
                                  🟢setRandomSeed0.018s
                                  🟢setRandomState0.018s
                                  🟢simplexNoise0.018s
                                  🟢triangulate0.018s

                                  🟢 love.physics

                                  • 🟢 22 Tests
                                  • 🔴 0 Failures
                                  • 🟡 6 Skipped
                                  • 0.492s


                                    • MethodTimeDetails
                                      🟡Body0.015stest class needs writing
                                      🟡Contact0.017stest class needs writing
                                      🟡Fixture0.017stest class needs writing
                                      🟡Joint0.018stest class needs writing
                                      🟡Shape0.018stest class needs writing
                                      🟡World0.018stest class needs writing
                                      🟢getDistance0.017s
                                      🟢getMeter0.016s
                                      🟢newBody0.017s
                                      🟢newChainShape0.018s
                                      🟢newCircleShape0.019s
                                      🟢newDistanceJoint0.018s
                                      🟢newEdgeShape0.017s
                                      🟢newFixture0.019s
                                      🟢newFrictionJoint0.019s
                                      🟢newGearJoint0.019s
                                      🟢newMotorJoint0.018s
                                      🟢newMouseJoint0.017s
                                      🟢newPolygonShape0.017s
                                      🟢newPrismaticJoint0.017s
                                      🟢newPulleyJoint0.017s
                                      🟢newRectangleShape0.018s
                                      🟢newRevoluteJoint0.017s
                                      🟢newRopeJoint0.018s
                                      🟢newWeldJoint0.019s
                                      🟢newWheelJoint0.016s
                                      🟢newWorld0.018s
                                      🟢setMeter0.018s

                                      🟢 love.sound

                                      • 🟢 2 Tests
                                      • 🔴 0 Failures
                                      • 🟡 2 Skipped
                                      • 0.072s


                                        • MethodTimeDetails
                                          🟡Decoder0.016stest class needs writing
                                          🟡SoundData0.019stest class needs writing
                                          🟢newDecoder0.020s
                                          🟢newSoundData0.017s

                                          🟢 love.system

                                          • 🟢 6 Tests
                                          • 🔴 0 Failures
                                          • 🟡 2 Skipped
                                          • 0.142s


                                            • MethodTimeDetails
                                              🟢getClipboardText0.016s
                                              🟢getOS0.017s
                                              🟢getPowerInfo0.018s
                                              🟢getProcessorCount0.018s
                                              🟢hasBackgroundMusic0.019s
                                              🟡openURL0.018scant test this worked
                                              🟢setClipboardText0.018s
                                              🟡vibrate0.018scant test this worked

                                              🟢 love.thread

                                              • 🟢 3 Tests
                                              • 🔴 0 Failures
                                              • 🟡 2 Skipped
                                              • 0.088s


                                                • MethodTimeDetails
                                                  🟡Channel0.015stest class needs writing
                                                  🟡Thread0.018stest class needs writing
                                                  🟢getChannel0.018s
                                                  🟢newChannel0.019s
                                                  🟢newThread0.018s

                                                  🟢 love.timer

                                                  • 🟢 6 Tests
                                                  • 🔴 0 Failures
                                                  • 🟡 0 Skipped
                                                  • 2.086s


                                                    • MethodTimeDetails
                                                      🟢getAverageDelta0.015s
                                                      🟢getDelta0.017s
                                                      🟢getFPS0.018s
                                                      🟢getTime1.008s
                                                      🟢sleep1.011s
                                                      🟢step0.018s

                                                      🟢 love.video

                                                      • 🟢 1 Tests
                                                      • 🔴 0 Failures
                                                      • 🟡 1 Skipped
                                                      • 0.031s


                                                        • MethodTimeDetails
                                                          🟡VideoStream0.014stest class needs writing
                                                          🟢newVideoStream0.017s

                                                          🟢 love.window

                                                          • 🟢 34 Tests
                                                          • 🔴 0 Failures
                                                          • 🟡 2 Skipped
                                                          • 5.273s


                                                            • MethodTimeDetails
                                                              🟢close0.035s
                                                              🟢fromPixels0.002s
                                                              🟢getDPIScale0.002s
                                                              🟢getDesktopDimensions0.016s
                                                              🟢getDisplayCount0.018s
                                                              🟢getDisplayName0.018s
                                                              🟢getDisplayOrientation0.019s
                                                              🟢getFullscreen1.346s
                                                              🟢getFullscreenModes0.017s
                                                              🟢getIcon0.016s
                                                              🟢getMode0.017s
                                                              🟢getPosition0.017s
                                                              🟢getSafeArea0.017s
                                                              🟢getTitle0.017s
                                                              🟢getVSync0.018s
                                                              🟢hasFocus0.018s
                                                              🟢hasMouseFocus0.018s
                                                              🟢isDisplaySleepEnabled0.018s
                                                              🟢isMaximized0.186s
                                                              🟢isMinimized0.655s
                                                              🟢isOpen0.045s
                                                              🟢isVisible0.032s
                                                              🟢maximize0.172s
                                                              🟢minimize0.637s
                                                              🟡requestAttention0.003scant test this worked
                                                              🟢restore0.650s
                                                              🟢setDisplaySleepEnabled0.012s
                                                              🟢setFullscreen1.122s
                                                              🟢setIcon0.006s
                                                              🟢setMode0.018s
                                                              🟢setPosition0.017s
                                                              🟢setTitle0.018s
                                                              🟢setVSync0.017s
                                                              🟡showMessageBox0.017scant test this worked
                                                              🟢toPixels0.018s
                                                              🟢updateMode0.019s
\ No newline at end of file diff --git a/testing/examples/lovetest_runAllTests.md b/testing/examples/lovetest_runAllTests.md index 4fabcde1d..cfe0105b0 100644 --- a/testing/examples/lovetest_runAllTests.md +++ b/testing/examples/lovetest_runAllTests.md @@ -1,26 +1,28 @@ - + -**305** tests were completed in **37.853s** with **244** passed, **0** failed, and **61** skipped +**305** tests were completed in **12.195s** with **254** passed, **1** failed, and **50** skipped ### Report | Module | Passed | Failed | Skipped | Time | | --------------------- | ------ | ------ | ------- | ------ | -| 🟢 love.audio | 26 | 0 | 0 | 2.605s | -| 🟢 love.data | 7 | 0 | 3 | 1.003s | -| 🟢 love.event | 4 | 0 | 2 | 0.600s | -| 🟢 love.filesystem | 27 | 0 | 2 | 3.030s | -| 🟢 love.font | 4 | 0 | 1 | 0.511s | -| 🟢 love.graphics | 81 | 0 | 15 | 10.599s | -| 🟢 love.image | 3 | 0 | 0 | 0.299s | -| 🟢 love.math | 17 | 0 | 0 | 1.821s | -| 🟢 love.objects | 1 | 0 | 34 | 3.603s | -| 🟢 love.physics | 22 | 0 | 0 | 2.222s | -| 🟢 love.sound | 2 | 0 | 0 | 0.199s | -| 🟢 love.system | 6 | 0 | 2 | 0.844s | -| 🟢 love.thread | 3 | 0 | 0 | 0.318s | -| 🟢 love.timer | 6 | 0 | 0 | 2.309s | -| 🟢 love.video | 1 | 0 | 0 | 0.114s | -| 🟢 love.window | 34 | 0 | 2 | 7.778s | +| 🟢 audio | 26 | 0 | 2 | 0.473s | +| 🟢 data | 7 | 0 | 5 | 0.212s | +| 🟢 event | 4 | 0 | 2 | 0.108s | +| 🟢 filesystem | 28 | 0 | 3 | 0.556s | +| 🟢 font | 4 | 0 | 3 | 0.127s | +| 🔴 graphics | 91 | 1 | 15 | 2.091s | +| 🟢 image | 3 | 0 | 2 | 0.087s | +| 🟢 math | 17 | 0 | 3 | 0.358s | +| 🟢 physics | 22 | 0 | 6 | 0.492s | +| 🟢 sound | 2 | 0 | 2 | 0.072s | +| 🟢 system | 6 | 0 | 2 | 0.142s | +| 🟢 thread | 3 | 0 | 2 | 0.088s | +| 🟢 timer | 6 | 0 | 0 | 2.086s | +| 🟢 video | 1 | 0 | 1 | 0.031s | +| 🟢 window | 34 | 0 | 2 | 5.273s | ### Failures +> 🔴 setColorMask +> assert #7 [check pixel b for yellow at 0,0(set color mask)] expected '0' got '1' + diff --git a/testing/examples/lovetest_runAllTests.xml b/testing/examples/lovetest_runAllTests.xml index 9c69661ed..73ada5cba 100644 --- a/testing/examples/lovetest_runAllTests.xml +++ b/testing/examples/lovetest_runAllTests.xml @@ -1,578 +1,693 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + assert #7 [check pixel b for yellow at 0,0(set color mask)] expected '0' got '1' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testing/main.lua b/testing/main.lua index 523d536d6..0e6e74e93 100644 --- a/testing/main.lua +++ b/testing/main.lua @@ -1,5 +1,5 @@ -- & 'c:\Program Files\LOVE\love.exe' ./ --console --- /Applications/love.app/Contents/MacOS/love ./ +-- /Applications/love_12.app/Contents/MacOS/love ./testing -- load test objs require('classes.TestSuite') @@ -25,7 +25,6 @@ if love.thread ~= nil then require('tests.thread') end if love.timer ~= nil then require('tests.timer') end if love.video ~= nil then require('tests.video') end if love.window ~= nil then require('tests.window') end -require('tests.objects') -- love.load -- load given arguments and run the test suite @@ -72,21 +71,21 @@ love.load = function(args) local cmderr = 'Invalid flag used' local modules = { 'audio', 'data', 'event', 'filesystem', 'font', 'graphics', - 'image', 'math', 'objects', 'physics', 'sound', 'system', + 'image', 'math', 'physics', 'sound', 'system', 'thread', 'timer', 'video', 'window' } + GITHUB_RUNNER = false for a=1,#arglist do if testcmd == '--runSpecificMethod' then if module == '' and love[ arglist[a] ] ~= nil then module = arglist[a] table.insert(modules, module) - end - if module ~= '' and love[module][ arglist[a] ] ~= nil and method == '' then - method = arglist[a] + elseif module ~= '' and love[module] ~= nil and method == '' then + if love.test[module][arglist[a]] ~= nil then method = arglist[a] end end end if testcmd == '--runSpecificModules' then - if love[ arglist[a] ] ~= nil or arglist[a] == 'objects' then + if love[ arglist[a] ] ~= nil and arglist[a] ~= '--isRunner' then table.insert(modules, arglist[a]) end end @@ -98,6 +97,9 @@ love.load = function(args) testcmd = arglist[a] modules = {} end + if arglist[a] == '--isRunner' then + GITHUB_RUNNER = true + end end -- runSpecificMethod uses the module + method given @@ -142,6 +144,10 @@ love.load = function(args) love.test.output = 'lovetest_runAllTests' end + if GITHUB_RUNNER then + love.test.module:log('grey', '--isRunner') + end + -- invalid command if love.test.module == nil then print(cmderr) @@ -183,6 +189,10 @@ love.quit = function() end +-- added so bad threads dont fail +function love.threaderror(thread, errorstr) end + + -- string split helper function UtilStringSplit(str, splitter) local splits = {} @@ -197,3 +207,7 @@ end function UtilTimeFormat(seconds) return string.format("%.3f", tostring(seconds)) end + +function UtilDebugLog(a, b, c) + if GITHUB_RUNNER == true then print("DEBUG ==> ", a, b, c) end +end diff --git a/testing/readme.md b/testing/readme.md index f322f7dd5..f9fdfd2cc 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -1,60 +1,87 @@ -# löve.test -Basic testing suite for the löve APIs, based off of [this issue](https://github.com/love2d/love/issues/1745) +# Lövetest +Basic testing suite for the [Löve](https://github.com/love2d/love) APIs, based off of [this issue](https://github.com/love2d/love/issues/1745). -Currently written for löve 12 +Currently written for [Löve 12](https://github.com/love2d/love/tree/12.0-development), which is still in development. --- -## Primary Goals +## Features - [x] Simple pass/fail tests in Lua with minimal setup -- [x] Ability to run all tests with a simple command. +- [x] Ability to run all tests with a simple command - [x] Ability to see how many tests are passing/failing -- [x] No platform-specific dependencies / scripts - [x] Ability to run a subset of tests -- [x] Ability to easily run an individual test. +- [x] Ability to easily run an individual test +- [x] Ability to see all visual results at a glance - [x] Automatic testing that happens after every commit +- [x] No platform-specific dependencies / scripts + +--- + +## Coverage +This is the status of all module tests currently. +| Module | Done | Todo | Skip | +| ----------------- | ---- | ---- | ---- | +| 🟢 audio | 28 | 0 | 0 | +| 🟢 data | 12 | 0 | 0 | +| 🟡 event | 4 | 1 | 1 | +| 🟢 filesystem | 28 | 0 | 2 | +| 🟢 font | 7 | 0 | 0 | +| 🟡 graphics | 93 | 14 | 1 | +| 🟢 image | 5 | 0 | 0 | +| 🟢 math | 20 | 0 | 0 | +| 🟡 physics | 22 | 6 | 0 | +| 🟢 sound | 4 | 0 | 0 | +| 🟢 system | 6 | 0 | 2 | +| 🟢 thread | 5 | 0 | 0 | +| 🟢 timer | 6 | 0 | 0 | +| 🟢 video | 2 | 0 | 0 | +| 🟢 window | 34 | 0 | 2 | + +> The following modules are not covered as we can't really emulate input nicely: +> `joystick`, `keyboard`, `mouse`, and `touch` --- ## Running Tests -The initial pass is to keep things as simple as possible, and just run all the tests inside Löve to match how they'd be used by developers in-engine. -To run the tests, download the repo and then run the main.lua as you would a löve game, i.e: +The testsuite aims to keep things as simple as possible, and just runs all the tests inside Löve to match how they'd be used by developers in-engine. +To run the tests, download the repo and then run the main.lua as you would a Löve game, i.e: WINDOWS: `& 'c:\Program Files\LOVE\love.exe' PATH_TO_TESTING_FOLDER --console` -MACOS: `/Applications/love.app/Contents/MacOS/love PATH_TO_TESTING_FOLDER` +MACOS: `/Applications/love.app/Contents/MacOS/love PATH_TO_TESTING_FOLDER` +LINUX: `./love.AppImage PATH_TO_TESTING_FOLDER` By default all tests will be run for all modules. - -If you want to specify a module you can add: -`--runSpecificModules filesystem` -For multiple modules, provide a comma seperate list: -`--runSpecificModules filesystem,audio,data"` - +If you want to specify a module/s you can use: +`--runSpecificModules filesystem,audio` If you want to specify only 1 specific method only you can use: `--runSpecificMethod filesystem write` All results will be printed in the console per method as PASS, FAIL, or SKIP with total assertions met on a module level and overall level. -An `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format) will be generated in the `/output` directory, along with a `HTML` and a `Markdown` file with a summary of all tests (including visuals for love.graphics tests). -> An example of both types of output can be found in the `/examples` folder - -The Markdown file can be used with [this github action](https://github.com/ellraiser/love-test-report) if you want to output the report results to your CI. +When finished, the following files will be generated in the `/output` directory with a summary of the test results: +- an `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format) +- a `HTML` file that shows any visual test results +- a `Markdown` file for use with [this github action](https://github.com/ellraiser/love-test-report) +> An example of all types of output can be found in the `/examples` +> The visual results of any graphic tests can be found in `/output/actual` --- ## Architecture -Each method has it's own test method written in `/tests` under the matching module name. +Each method and object has it's own test method written in `/tests` under the matching module name. When you run the tests, a single TestSuite object is created which handles the progress + totals for all the tests. Each module has a TestModule object created, and each test method has a TestMethod object created which keeps track of assertions for that method. You can currently do the following assertions: - **assertNotNil**(value) -- **assertEquals**(expected, actual) -- **assertNotEquals**(expected, actual) -- **assertRange**(actual, min, max) -- **assertMatch**({option1, option2, option3 ...}, actual) -- **assertGreaterEqual**(expected, actual) -- **assertLessEqual**(expected, actual) +- **assertEquals**(expected, actual, label) +- **assertNotEquals**(expected, actual, label) +- **assertRange**(actual, min, max, label) +- **assertMatch**({option1, option2, option3 ...}, actual, label) +- **assertGreaterEqual**(expected, actual, label) +- **assertLessEqual**(expected, actual, label) - **assertObject**(table) +- **assertPixels**(imgdata, pixeltable, label) +- **assertCoords**(expected, actual, label) Example test method: ```lua @@ -76,52 +103,22 @@ end After each test method is ran, the assertions are totalled up, printed, and we move onto the next method! Once all methods in the suite are run a total pass/fail/skip is given for that module and we move onto the next module (if any) -For sanity-checking, if it's currently not covered or we're not sure how to test yet we can set the test to be skipped with `test:skipTest(reason)` - this way we still see the method listed in the tests without it affected the pass/fail totals - ---- - -## Coverage -This is the status of all module tests currently. -| Module | Passed | Failed | Skipped | Time | -| --------------------- | ------ | ------ | ------- | ------ | -| 🟢 love.audio | 26 | 0 | 0 | 2.602s | -| 🟢 love.data | 7 | 0 | 3 | 1.003s | -| 🟢 love.event | 4 | 0 | 2 | 0.599s | -| 🟢 love.filesystem | 27 | 0 | 2 | 2.900s | -| 🟢 love.font | 4 | 0 | 1 | 0.500s | -| 🟢 love.graphics | 81 | 0 | 15 | 10.678s | -| 🟢 love.image | 3 | 0 | 0 | 0.300s | -| 🟢 love.math | 17 | 0 | 0 | 1.678s | -| 🟢 love.physics | 22 | 0 | 0 | 2.197s | -| 🟢 love.sound | 2 | 0 | 0 | 0.200s | -| 🟢 love.system | 6 | 0 | 2 | 0.802s | -| 🟢 love.thread | 3 | 0 | 0 | 0.300s | -| 🟢 love.timer | 6 | 0 | 0 | 2.358s | -| 🟢 love.video | 1 | 0 | 0 | 0.100s | -| 🟢 love.window | 34 | 0 | 2 | 8.050s | - -The following modules are not covered as we can't really emulate input nicely: -`joystick`, `keyboard`, `mouse`, and `touch` +For sanity-checking, if it's currently not covered or it's not possible to test the method we can set the test to be skipped with `test:skipTest(reason)` - this way we still see the method listed in the test output without it affected the pass/fail totals --- ## Todo Modules with some small bits needed or needing sense checking: -- **love.data** - packing methods need writing cos i dont really get what they are - **love.event** - love.event.wait or love.event.pump need writing if possible I dunno how to check - **love.font** - newBMFontRasterizer() wiki entry is wrong so not sure whats expected - **love.graphics** - still need to do tests for the main drawing methods - **love.image** - ideally isCompressed should have an example of all compressed files love can take -- **love.math** - linearToGamma + gammaToLinear using direct formulas don't get same value back - **love.*.objects** - all objects tests still to be done - **love.graphics.setStencilTest** - deprecated, replaced by setStencilMode() --- -## Stretch Goals -- [ ] Tests can compare visual results to a reference image -- [ ] Ability to see all visual results at a glance +## Future Goals +- [ ] Tests can compare visual results to a reference image (partially done) - [ ] Ability to test loading different combinations of modules - [ ] Performance tests - -There is some unused code in the Test.lua class to add preview vs actual images to the HTML output diff --git a/testing/resources/alsoft.conf b/testing/resources/alsoft.conf new file mode 100644 index 000000000..3e28208eb --- /dev/null +++ b/testing/resources/alsoft.conf @@ -0,0 +1,4 @@ +[general] +drivers = wave +[wave] +file = output.wav \ No newline at end of file diff --git a/testing/resources/clickmono.ogg b/testing/resources/clickmono.ogg new file mode 100644 index 0000000000000000000000000000000000000000..d1b567e7d261ca5baa6c81fba0d7891ce6b14c2d GIT binary patch literal 3883 zcmai1eOyvm`aftY8M@?JQe!PNmf%}rYU0?Wr1`GJONuUQifEvi3205(IEk*AnHf@& zIcbV{Qz}v`nw+w|TB)0;?U@KdEcK~_33Br8{t zvpq}1&yrA3(8cg#ZcmfsCFk(hMJ4B^`S^Kw`*=`2Juwy^(Emc;umx&j0D;G%Y^-K{ z7qNedSWewool+UGzfrcB9(F=(&upgYYBE|bw-aUfrOZtfi)uzWL$HKbfl~O$@Rbrf zf9DfCd}8?Z;bR#Gf;t>!HcCbm<))lbO2;l?mQlLpj0n2bN{Ow%-jP`zK@Pf9BR}H!joNuF5WiGo z4K@LQFRde#n#qb=%zzgF^G=e>pOMQyrB(967n@XIcJKgP%eD_cY=7sxQ{;DUk%PgT z+4)1hZ1#+lt3xNzJ9QC?8W`48-MEz4g-a!1Z8#Qy2m`l~+=Vy)Ej%EFOe7&H1>v$InnBF3m}!Zi9L?V!OgL$_J|UramYGL1jI( zrotT?2~bbjrVkSO4nx`EHWf|i(G95;&-LLVk0D46(4dOxhB!2dvtv-?`Wbyf7Tp0- zpD$_JEvBQgKlDC?2l^XC@GaiaL=5}-)K`R%62a{TtFcozoVMX|teZnmojS~TL6oz4 z!YL;{c#Z{tB(rCPk%~UvN=U_ol-rc1ntj$T%?4^^8*g zj8^|?L_I&DUL{nMk86xt_5Ye4rUI`3;QnF9JBJ-%frmo^V~Q@^3uYi2cdG&xJ*@bT zKF0nG1Im41@t+9*z|-jl!!1l{t9#}1Aj_`7mLG$N< z%>c-#VUz~@lrmaV&4x0H;h4CXs&^EZ(+npi3>QOCAMI$UWM-gz( zd)*+5eb1Xc1X$79d2a&P zzeEj6*9}VeLsC(ql*^rsVk)9_Rs2DzXtavY&Et>E`V30AgKYkYggcVUkGsg_%;XPB zi=I~Tlj8UsLN0fLOLda%6!hh*l{ybj;?BaSTw$ttD9wWW{Th{ zihNnhC4A2QC7+pFG%n#k)fGMEWO4lz52X3YRig2DK8Ln77PT_7%HO%!64vBcx`D2{4q`dNRg8#R#Cz_G7$JMU5CbtFO zzB2Y)nCsM(sf}|8WL-wP&KonJ$wa8%-d>nm44T?M_XgIHT+IsnFyN5W{`yo-J(;5*m#QYU z_1m=S27#(sP%B7KrYltfL_<-k-2_TOLT#E-*;K9Crc`GrRV}3|N}o#Ds}U$QFSQ!c z6?Nuly}-m~DphV*G-pQDFJEXIII8AdwE|%+gfc0s&+Mudeo?y(sU;(b5J6fI#4Qo7 zDkqy&&ZSVIYE>dGeJbR!Mu2o=B8cb;^75@lWYj`SM2O1$I3h%mHEyHY)zB&wS!t+N zK{GOyh-+ePlM+SN?^i)^x8o|LS7E3|Ao7d-wHYR4;bTOgM3LQ(t6cijqPb3EuOgBP42}D!W~xuqGG}rSH3RYJ(}+H~kU6K_ru=A?%c#bEP7AG? z>Q!$)gR~e?_NTY%Y@^om8%^dM((+d8I;!1n^ctPX4~8Yk^bw81eF95xh7Uy#yhVv@ zcA{_ePzN8DAZ)40-q9m)7Y#=bwTUAM9I?PEyYMq1A#ZU;$7#5f9^8FMO=wh1bHU zHX|Lc!W4%6^#YiwL?}@;BWj~j`9WfQ0pnwmXtf^7`ep<%YBg$@6h!TMMf1`K3B=f| zcAM)$v}#uvQe)RS_&Q9%Xvg;NVR!GGn(I2;YSenX>!RX9G2n;!wjj{Lx1~Ir;k`J1 z+wBNIGzSHqmZU;F-I64$U__7_<#w=L{{Vkhx6+r8(cX(UhYSW)!IIz^>5tp*=Ysj* z(V=Wm@r5UqT2xfrG7m6d_vOJe8Pz}xE~E7jBz6&{uuW2}8XH(NE0TvSL_x*T?Wzu}5pSGGoBU@O@6d zkLk-jACDy%;AdkCPFnq!TZ=$J;6@5mvGteP^I+acvM>_L(y@zBc9{(C(&LD-q*T)? zo_@Qg(AFP%cRvU!E+{F{ySRCHdU^Z$`3In(Jk!X6tBOV|UP5&Y0ZC_v#0rWovicz8{Sb+O<#j?Mwa$4oQ z>g&^(vfhiq4%HsZ?VF~*eDT?5>e!mLf4^CE=*O9(E$XGaOQ+-Jmdkqgb#2d&f73e@ z{5pf0zMC^LHI{kc8SCcq*}Kj?dv5Qv+0(;$%J6)ce)O0+KQT6W-(=4M%c97iS$U34 z`R1~lmo1MuQ+iy_b|0NsXN;J1Z%1%z4Pzny$Xou(8Z_K|Ov+1Yw~e=T5Y~T5TQ;#i zFTKds=hivT+5WH79Uk{jH^KkWhhdu9hY@OcmFt=x!Sfi!o1J|Fs3s=8gSOxYzg9uU(<9&;Q?bnm}m(!&k*RY0TG8hUYtN zsfueoLdS;91CoR8S)!}%>YV|N$Mr+}^(ifnm_G?pOEK}5m=)Fw-wR_e@uWw75i?o4 zYeF0@h{OK8?#H{v{LWpkvvk^;|;oR!}(Ci-DU?Zdv2e$sz_7p~9q zb%ZTOVcGTcSNCPzC(R42lGcB|Vda*q|1jU{Y!UnK;rECB>H6sE)#)eLx)sFbzYush ztF8P54%@?w0x-O;leY5cW^27}HxJ;!f(dV=OP<7>QhFzepJj_X}% v%Wl{_|7=|JyvtQFwbfUOTVQ;2DTRFGK-Dtv*K344vulJb=CJL(9ANwZTBe{N literal 0 HcmV?d00001 diff --git a/testing/tests/audio.lua b/testing/tests/audio.lua index a174b48c8..86912966e 100644 --- a/testing/tests/audio.lua +++ b/testing/tests/audio.lua @@ -1,6 +1,172 @@ -- love.audio +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- RecordingDevice (love.audio.getRecordingDevices) +love.test.audio.RecordingDevice = function(test) + -- check devices first + local devices = love.audio.getRecordingDevices() + if #devices == 0 then + return test:skipTest('cant test this works: no recording devices found') + end + -- test device + if test:isDelayed() == false then + -- check object created and basics + local device = devices[1] + test.store.device = device + test:assertObject(device) + test:assertMatch({1, 2}, device:getChannelCount(), 'check channel count is 1 or 2') + test:assertNotEquals(nil, device:getName(), 'check has name') + -- check initial data is empty as we haven't recorded anything yet + test:assertNotNil(device:getBitDepth()) + test:assertEquals(nil, device:getData(), 'check initial data empty') + test:assertEquals(0, device:getSampleCount(), 'check initial sample empty') + test:assertNotNil(device:getSampleRate()) + test:assertEquals(false, device:isRecording(), 'check not recording') + -- start recording for a short time + local startrecording = device:start(32000, 4000, 16, 1) + test:assertEquals(true, startrecording, 'check recording started') + test:assertEquals(true, device:isRecording(), 'check now recording') + test:assertEquals(4000, device:getSampleRate(), 'check sample rate set') + test:assertEquals(16, device:getBitDepth(), 'check bit depth set') + test:assertEquals(1, device:getChannelCount(), 'check channel count set') + test:setDelay(20) + -- after recording + else + local device = test.store.device + local recording = device:stop() + test:assertEquals(false, device:isRecording(), 'check not recording') + test:assertEquals(nil, device:getData(), 'using stop should clear buffer') + test:assertObject(recording) + end +end + + +-- Source (love.audio.newSource) +love.test.audio.Source = function(test) + -- create stereo source + local stereo = love.audio.newSource('resources/click.ogg', 'static') + test:assertObject(stereo) + -- check stereo props + test:assertEquals(2, stereo:getChannelCount(), 'check stereo src') + test:assertEquals(66, math.floor(stereo:getDuration("seconds")*1000), 'check stereo seconds') + test:assertNotNil(stereo:getFreeBufferCount()) + test:assertEquals('static', stereo:getType(), 'check stereo type') + -- check cloning a stereo + local clone = stereo:clone() + test:assertEquals(2, clone:getChannelCount(), 'check clone stereo src') + test:assertEquals(66, math.floor(clone:getDuration("seconds")*1000), 'check clone stereo seconds') + test:assertNotNil(clone:getFreeBufferCount()) + test:assertEquals('static', clone:getType(), 'check cloned stereo type') + -- mess with stereo playing + test:assertEquals(false, stereo:isPlaying(), 'check not playing') + stereo:setLooping(true) + stereo:play() + test:assertEquals(true, stereo:isPlaying(), 'check now playing') + test:assertEquals(true, stereo:isLooping(), 'check now playing') + stereo:pause() + stereo:seek(0.01, 'seconds') + test:assertEquals(0.01, stereo:tell('seconds'), 'check seek/tell') + stereo:stop() + test:assertEquals(false, stereo:isPlaying(), 'check stopped playing') + -- check volume limits + stereo:setVolumeLimits(0.1, 0.5) + local min, max = stereo:getVolumeLimits() + test:assertEquals(1, math.floor(min*10), 'check min limit') + test:assertEquals(5, math.floor(max*10), 'check max limit') + -- @NOTE the following works as setVolumeLimits is used with set volume + -- as the BASE and then applying directional, rather than being a clamp + stereo:setVolume(1) + test:assertEquals(1, stereo:getVolume(), 'check set volume') + stereo:setVolume(0) + test:assertEquals(0, stereo:getVolume(), 'check set volume') + -- change some get/set props that can apply to stereo + stereo:setPitch(2) + test:assertEquals(2, stereo:getPitch(), 'check pitch change') + -- create mono source + local mono = love.audio.newSource('resources/clickmono.ogg', 'stream') + test:assertObject(mono) + test:assertEquals(1, mono:getChannelCount(), 'check mono src') + test:assertEquals(2927, mono:getDuration("samples"), 'check mono seconds') + test:assertEquals('stream', mono:getType(), 'check mono type') + -- check the basic get/set properties + test:assertEquals(0, mono:getAirAbsorption(), 'get air absorption') + mono:setAirAbsorption(1) + test:assertEquals(1, mono:getAirAbsorption(), 'set air absorption') + mono:setCone(0, 90*(math.pi/180), 1) + local ia, oa, ov = mono:getCone() + test:assertEquals(0, ia, 'check cone ia') + test:assertEquals(math.floor(9000*(math.pi/180)), math.floor(oa*100), 'check cone oa') + test:assertEquals(1, ov, 'check cone ov') + mono:setDirection(3, 1, -1) + local x, y, z = mono:getDirection() + test:assertEquals(3, x, 'check direction x') + test:assertEquals(1, y, 'check direction y') + test:assertEquals(-1, z, 'check direction z') + mono:setRelative(true) + test:assertEquals(true, mono:isRelative(), 'check set relative') + mono:setPosition(1, 2, 3) + x, y, z = mono:getPosition() + test:assertEquals(x, 1, 'check pos x') + test:assertEquals(y, 2, 'check pos y') + test:assertEquals(z, 3, 'check pos z') + mono:setVelocity(1, 3, 4) + x, y, z = mono:getVelocity() + test:assertEquals(x, 1, 'check velocity x') + test:assertEquals(y, 3, 'check velocity x') + test:assertEquals(z, 4, 'check velocity x') + mono:setRolloff(1) + test:assertEquals(1, mono:getRolloff(), 'check rolloff set') + -- create queue source + local queue = love.audio.newQueueableSource(44100, 16, 1, 3) + local sdata = love.sound.newSoundData(1024, 44100, 16, 1) + test:assertObject(queue) + local run = queue:queue(sdata) + test:assertEquals(true, run, 'check queued sound') + queue:stop() + -- check making a filer + local setfilter = stereo:setFilter({ + type = 'lowpass', + volume = 0.5, + highgain = 0.3 + }) + test:assertEquals(true, setfilter, 'check filter applied') + local filter = stereo:getFilter() + test:assertEquals('lowpass', filter.type, 'check filter type') + test:assertEquals(0.5, filter.volume, 'check filter volume') + test:assertEquals(3, math.floor(filter.highgain*10), 'check filter highgain') + test:assertEquals(nil, filter.lowgain, 'check filter lowgain') + -- add an effect + local effsource = love.audio.newSource('resources/click.ogg', 'static') + love.audio.setEffect('testeffect', { + type = 'flanger', + volume = 10 + }) + local seteffect, err = effsource:setEffect('flanger', { + type = 'highpass', + volume = 0.3, + lowgain = 0.1 + }) + -- both these fail on 12 using stereo or mono, no err + test:assertEquals(true, seteffect, 'check effect was applied') + local filtersettings = effsource:getEffect('chorus', {}) + test:assertNotNil(filtersettings) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.audio.getActiveEffects love.test.audio.getActiveEffects = function(test) -- check we get a value @@ -142,14 +308,14 @@ end -- love.audio.newQueueableSource --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.audio.newQueueableSource = function(test) test:assertObject(love.audio.newQueueableSource(32, 8, 1, 8)) end -- love.audio.newSource --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.audio.newSource = function(test) test:assertObject(love.audio.newSource('resources/click.ogg', 'static')) test:assertObject(love.audio.newSource('resources/click.ogg', 'stream')) diff --git a/testing/tests/data.lua b/testing/tests/data.lua index dac5f3c06..bfd5413d0 100644 --- a/testing/tests/data.lua +++ b/testing/tests/data.lua @@ -1,6 +1,61 @@ -- love.data +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- ByteData (love.data.newByteData) +love.test.data.ByteData = function(test) + -- create new obj + local data = love.data.newByteData('helloworld') + test:assertObject(data) + -- check properties match expected + test:assertEquals('helloworld', data:getString(), 'check data string') + test:assertEquals(10, data:getSize(), 'check data size') + -- check cloning the bytedata + local cloneddata = data:clone() + test:assertObject(cloneddata) + test:assertEquals('helloworld', cloneddata:getString(), 'check cloned data') + test:assertEquals(10, cloneddata:getSize(), 'check cloned size') + -- check pointer access if allowed + if data:getFFIPointer() ~= nil and ffi ~= nil then + local pointer = data:getFFIPointer() + local ptr = ffi.cast('uint8_t*', pointer) + local byte5 = ptr[4] + test:assertEquals('o', byte5) + end +end + + +-- CompressedData (love.data.compress) +love.test.data.CompressedData = function(test) + -- create new compressed data + local cdata = love.data.compress('data', 'zlib', 'helloworld', -1) + test:assertObject(cdata) + test:assertEquals('zlib', cdata:getFormat(), 'check format used') + -- check properties match expected + test:assertEquals(18, cdata:getSize()) + test:assertEquals('helloworld', love.data.decompress('data', cdata):getString()) + -- check cloning the data + local clonedcdata = cdata:clone() + test:assertObject(clonedcdata) + test:assertEquals('zlib', clonedcdata:getFormat()) + test:assertEquals(18, clonedcdata:getSize()) + test:assertEquals('helloworld', love.data.decompress('data', clonedcdata):getString()) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.data.compress love.test.data.compress = function(test) -- here just testing each combo 'works' - in decompress's test method @@ -119,9 +174,13 @@ end -- love.data.getPackedSize --- @NOTE I don't really get what lua packing types are so skipping for now - ell love.test.data.getPackedSize = function(test) - test:skipTest('test class needs writing') + local pack1 = love.data.getPackedSize('>xI3b') + local pack2 = love.data.getPackedSize('>I2B') + local pack3 = love.data.getPackedSize('>I4I4I4I4x') + test:assertEquals(5, pack1, 'check pack size 1') + test:assertEquals(3, pack2, 'check pack size 2') + test:assertEquals(17, pack3, 'check pack size 3') end @@ -145,28 +204,39 @@ end -- love.data.newByteData --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.data.newByteData = function(test) test:assertObject(love.data.newByteData('helloworld')) end -- love.data.newDataView --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.data.newDataView = function(test) test:assertObject(love.data.newDataView(love.data.newByteData('helloworld'), 0, 10)) end -- love.data.pack --- @NOTE I don't really get what lua packing types are so skipping for now - ell love.test.data.pack = function(test) - test:skipTest('test class needs writing') + local packed1 = love.data.pack('string', '>I4I4I4I4', 9999, 1000, 1010, 2030) + local packed2 = love.data.pack('data', '>I4I4I4I4', 9999, 1000, 1010, 2030) + local a, b, c, d = love.data.unpack('>I4I4I4I4', packed1) + local e, f, g, h = love.data.unpack('>I4I4I4I4', packed2) + test:assertEquals(9999+9999, a+e, 'check packed 1') + test:assertEquals(1000+1000, b+f, 'check packed 2') + test:assertEquals(1010+1010, c+g, 'check packed 3') + test:assertEquals(2030+2030, d+h, 'check packed 4') end -- love.data.unpack --- @NOTE I don't really get what lua packing types are so skipping for now - ell love.test.data.unpack = function(test) - test:skipTest('test class needs writing') + local packed1 = love.data.pack('string', '>s5s4I3', 'hello', 'love', 100) + local packed2 = love.data.pack('data', '>s5I2', 'world', 20) + local a, b, c = love.data.unpack('>s5s4I3', packed1) + local d, e = love.data.unpack('>s5I2', packed2) + test:assertEquals(a .. ' ' .. d, 'hello world', 'check unpack 1') + test:assertEquals(b, 'love', 'check unpack 2') + test:assertEquals(c - e, 80, 'check unpack 3') end diff --git a/testing/tests/event.lua b/testing/tests/event.lua index ff667c394..9e43f8b82 100644 --- a/testing/tests/event.lua +++ b/testing/tests/event.lua @@ -1,6 +1,13 @@ -- love.event +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.event.clear love.test.event.clear = function(test) -- push some events first @@ -35,7 +42,7 @@ end -- love.event.pump -- @NOTE dont think can really test as internally used love.test.event.pump = function(test) - test:skipTest('not sure can be tested as used internally') + test:skipTest('used internally') end diff --git a/testing/tests/filesystem.lua b/testing/tests/filesystem.lua index 248aa39c4..224a7e916 100644 --- a/testing/tests/filesystem.lua +++ b/testing/tests/filesystem.lua @@ -1,6 +1,101 @@ -- love.filesystem +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- File (love.filesystem.newFile) +love.test.filesystem.File = function(test) + -- setup a file to play with + local file1 = love.filesystem.openFile('data.txt', 'w') + file1:write('helloworld') + test:assertObject(file1) + file1:close() + -- test read mode + file1:open('r') + test:assertEquals('r', file1:getMode(), 'check read mode') + local contents, size = file1:read() + test:assertEquals('helloworld', contents) + test:assertEquals(10, size, 'check file read') + test:assertEquals(10, file1:getSize()) + local ok, err = file1:write('hello') + test:assertNotEquals(nil, err, 'check cant write in read mode') + local iterator = file1:lines() + test:assertNotEquals(nil, iterator, 'check can read lines') + test:assertEquals('data.txt', file1:getFilename(), 'check filename matches') + file1:close() + -- test write mode + file1:open('w') + test:assertEquals('w', file1:getMode(), 'check write mode') + contents, size = file1:read() + test:assertEquals(nil, contents, 'check cant read file in write mode') + test:assertEquals('string', type(size), 'check err message shown') + ok, err = file1:write('helloworld') + test:assertEquals(true, ok, 'check file write') + test:assertEquals(nil, err, 'check no err writing') + -- test open/closing + file1:open('r') + test:assertEquals(true, file1:isOpen(), 'check file is open') + file1:close() + test:assertEquals(false, file1:isOpen(), 'check file gets closed') + file1:close() + -- test buffering and flushing + file1:open('w') + ok, err = file1:setBuffer('full', 10000) + test:assertEquals(true, ok) + test:assertEquals('full', file1:getBuffer()) + file1:write('replacedcontent') + file1:flush() + file1:close() + file1:open('r') + contents, size = file1:read() + test:assertEquals('replacedcontent', contents, 'check buffered content was written') + file1:close() + -- loop through file data with seek/tell until EOF + file1:open('r') + local counter = 0 + for i=1,100 do + file1:seek(i) + test:assertEquals(i, file1:tell()) + if file1:isEOF() == true then + counter = i + break + end + end + test:assertEquals(counter, 15) + file1:close() +end + + +-- FileData (love.filesystem.newFileData) +love.test.filesystem.FileData = function(test) + -- create new obj + local fdata = love.filesystem.newFileData('helloworld', 'test.txt') + test:assertObject(fdata) + test:assertEquals('test.txt', fdata:getFilename()) + test:assertEquals('txt', fdata:getExtension()) + -- check properties match expected + test:assertEquals('helloworld', fdata:getString(), 'check data string') + test:assertEquals(10, fdata:getSize(), 'check data size') + -- check cloning the bytedata + local clonedfdata = fdata:clone() + test:assertObject(clonedfdata) + test:assertEquals('helloworld', clonedfdata:getString(), 'check cloned data') + test:assertEquals(10, clonedfdata:getSize(), 'check cloned size') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.filesystem.append love.test.filesystem.append = function(test) -- create a new file to test with @@ -116,7 +211,7 @@ end -- love.filesystem.getSource -- @NOTE i dont think we can test this cos love calls it first love.test.filesystem.getSource = function(test) - test:skipTest('not sure can be tested as used internally') + test:skipTest('used internally') end @@ -229,7 +324,7 @@ end -- love.filesystem.openFile --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.filesystem.openFile = function(test) test:assertNotNil(love.filesystem.openFile('file2.txt', 'w')) test:assertNotNil(love.filesystem.openFile('file2.txt', 'r')) @@ -240,7 +335,7 @@ end -- love.filesystem.newFileData --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.filesystem.newFileData = function(test) test:assertNotNil(love.filesystem.newFileData('helloworld', 'file1')) end @@ -307,9 +402,8 @@ end -- love.filesystem.setSource --- @NOTE dont think can test this cos used internally? love.test.filesystem.setSource = function(test) - test:skipTest('not sure can be tested as used internally') + test:skipTest('used internally') end diff --git a/testing/tests/font.lua b/testing/tests/font.lua index 84c3f4568..695da4120 100644 --- a/testing/tests/font.lua +++ b/testing/tests/font.lua @@ -1,16 +1,76 @@ -- love.font +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- GlyphData (love.font.newGlyphData) +love.test.font.GlyphData = function(test) + -- create obj + local rasterizer = love.font.newRasterizer('resources/font.ttf') + local gdata = love.font.newGlyphData(rasterizer, 97) -- 'a' + test:assertObject(gdata) + -- check properties match expected + test:assertNotNil(gdata:getString()) + test:assertEquals(128, gdata:getSize(), 'check data size') + test:assertEquals(9, gdata:getAdvance(), 'check advance') + test:assertEquals('la8', gdata:getFormat(), 'check format') + test:assertEquals(97, gdata:getGlyph(), 'check glyph number') + test:assertEquals('a', gdata:getGlyphString(), 'check glyph string') + test:assertEquals(8, gdata:getHeight(), 'check height') + test:assertEquals(8, gdata:getWidth(), 'check width') + -- check boundary + local x, y, w, h = gdata:getBoundingBox() + local dw, dh = gdata:getDimensions() + local bw, bh = gdata:getBearing() + test:assertEquals(0, x, 'check bbox x') + test:assertEquals(-3, y, 'check bbox y') + test:assertEquals(8, w, 'check bbox w') + test:assertEquals(14, h, 'check bbox h') + test:assertEquals(8, dw, 'check dim width') + test:assertEquals(8, dh, 'check dim height') + test:assertEquals(0, bw, 'check bearing w') + test:assertEquals(11, bh, 'check bearing h') +end + + +-- Rasterizer (love.font.newRasterizer) +love.test.font.Rasterizer = function(test) + -- create obj + local rasterizer = love.font.newRasterizer('resources/font.ttf') + test:assertObject(rasterizer) + -- check properties match + test:assertEquals(9, rasterizer:getAdvance(), 'check advance') + test:assertEquals(9, rasterizer:getAscent(), 'check ascent') + test:assertEquals(-3, rasterizer:getDescent(), 'check descent') + test:assertEquals(77, rasterizer:getGlyphCount(), 'check glyph count') + test:assertObject(rasterizer:getGlyphData('L')) + test:assertEquals(12, rasterizer:getHeight(), 'check height') + test:assertEquals(15, rasterizer:getLineHeight(), 'check line height') + test:assertEquals(true, rasterizer:hasGlyphs('L', 'O', 'V', 'E'), 'check LOVE') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.font.newBMFontRasterizer --- @NOTE the wiki specifies diff. params to source code and trying to do --- what source code wants gives some errors still love.test.font.newBMFontRasterizer = function(test) - test:skipTest('wiki and source dont match, not sure expected usage') + local rasterizer = love.font.newBMFontRasterizer('resources/love.png'); + test:assertObject(rasterizer) end -- love.font.newGlyphData --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.font.newGlyphData = function(test) local img = love.image.newImageData('resources/love.png') local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1); @@ -20,7 +80,7 @@ end -- love.font.newImageRasterizer --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.font.newImageRasterizer = function(test) local img = love.image.newImageData('resources/love.png') local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1); @@ -29,14 +89,14 @@ end -- love.font.newRasterizer --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.font.newRasterizer = function(test) test:assertObject(love.font.newRasterizer('resources/font.ttf')) end -- love.font.newTrueTypeRasterizer --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.font.newTrueTypeRasterizer = function(test) test:assertObject(love.font.newTrueTypeRasterizer(12, "normal", 1)) test:assertObject(love.font.newTrueTypeRasterizer('resources/font.ttf', 8, "normal", 1)) diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index 203c22aa0..8a1d0f28b 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -1,6 +1,79 @@ -- love.graphics +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Canvas (love.graphics.newCanvas) +love.test.graphics.Canvas = function(test) + test:skipTest('test class needs writing') +end + + +-- Font (love.graphics.newFont) +love.test.graphics.Font = function(test) + test:skipTest('test class needs writing') +end + + +-- Image (love.graphics.newImage) +love.test.graphics.Image = function(test) + test:skipTest('test class needs writing') +end + + +-- Mesh (love.graphics.newMesh) +love.test.graphics.Mesh = function(test) + test:skipTest('test class needs writing') +end + + +-- ParticleSystem (love.graphics.newParticleSystem) +love.test.graphics.ParticleSystem = function(test) + test:skipTest('test class needs writing') +end + + +-- Quad (love.graphics.newQuad) +love.test.graphics.Quad = function(test) + test:skipTest('test class needs writing') +end + + +-- Shader (love.graphics.newShader) +love.test.graphics.Shader = function(test) + test:skipTest('test class needs writing') +end + + +-- SpriteBatch (love.graphics.newSpriteBatch) +love.test.graphics.SpriteBatch = function(test) + test:skipTest('test class needs writing') +end + + +-- Text (love.graphics.newTextBatch) +love.test.graphics.Text = function(test) + test:skipTest('test class needs writing') +end + + +-- Texture (love.graphics.newTexture) +love.test.graphics.Texture = function(test) + test:skipTest('test class needs writing') +end + + +-- Video (love.graphics.newVideo) +love.test.graphics.Video = function(test) + test:skipTest('test class needs writing') +end + + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------DRAWING------------------------------------- @@ -222,7 +295,17 @@ end -- love.graphics.flushBatch love.test.graphics.flushBatch = function(test) - test:skipTest('not sure can be tested as used internally') + love.graphics.flushBatch() + local initial = love.graphics.getStats()['drawcalls'] + local canvas = love.graphics.newCanvas(32, 32) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.rectangle('fill', 0, 0, 32, 32) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setCanvas() + love.graphics.flushBatch() + local after = love.graphics.getStats()['drawcalls'] + test:assertEquals(initial+1, after, 'check drawcalls increased') end @@ -418,7 +501,7 @@ end -- love.graphics.newArrayImage --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newArrayImage = function(test) test:assertObject(love.graphics.newArrayImage({ 'resources/love.png', 'resources/love2.png', 'resources/love3.png' @@ -426,7 +509,7 @@ love.test.graphics.newArrayImage = function(test) end -- love.graphics.newCanvas --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newCanvas = function(test) test:assertObject(love.graphics.newCanvas(16, 16, { type = '2d', @@ -441,7 +524,7 @@ end -- love.graphics.newCubeImage --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newCubeImage = function(test) test:assertObject(love.graphics.newCubeImage('resources/cubemap.png', { mipmaps = false, @@ -451,7 +534,7 @@ end -- love.graphics.newFont --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newFont = function(test) test:assertObject(love.graphics.newFont('resources/font.ttf')) test:assertObject(love.graphics.newFont('resources/font.ttf', 8, "normal", 1)) @@ -459,7 +542,7 @@ end -- love.graphics.newImage --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newImage = function(test) test:assertObject(love.graphics.newImage('resources/love.png', { mipmaps = false, @@ -470,21 +553,21 @@ end -- love.graphics.newImageFont --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newImageFont = function(test) test:assertObject(love.graphics.newImageFont('resources/love.png', 'ABCD', 1)) end -- love.graphics.newMesh --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newMesh = function(test) test:assertObject(love.graphics.newMesh({{1, 1, 0, 0, 1, 1, 1, 1}}, 'fan', 'dynamic')) end -- love.graphics.newParticleSystem --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newParticleSystem = function(test) local imgdata = love.graphics.newImage('resources/love.png') test:assertObject(love.graphics.newParticleSystem(imgdata, 1000)) @@ -492,7 +575,7 @@ end -- love.graphics.newQuad --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newQuad = function(test) local imgdata = love.graphics.newImage('resources/love.png') test:assertObject(love.graphics.newQuad(0, 0, 16, 16, imgdata)) @@ -500,16 +583,25 @@ end -- love.graphics.newShader --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newShader = function(test) - local pixelcode = 'vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { vec4 texturecolor = Texel(tex, texture_coords); return texturecolor * color;}' - local vertexcode = 'vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; }' + local pixelcode = [[ + vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { + vec4 texturecolor = Texel(tex, texture_coords); + return texturecolor * color; + } + ]] + local vertexcode = [[ + vec4 position(mat4 transform_projection, vec4 vertex_position) { + return transform_projection * vertex_position; + } + ]] test:assertObject(love.graphics.newShader(pixelcode, vertexcode)) end -- love.graphics.newSpriteBatch --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newSpriteBatch = function(test) local imgdata = love.graphics.newImage('resources/love.png') test:assertObject(love.graphics.newSpriteBatch(imgdata, 1000)) @@ -517,7 +609,7 @@ end -- love.graphics.newText --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newTextBatch = function(test) local font = love.graphics.newFont('resources/font.ttf') test:assertObject(love.graphics.newTextBatch(font, 'helloworld')) @@ -525,7 +617,7 @@ end -- love.graphics.newVideo --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newVideo = function(test) test:assertObject(love.graphics.newVideo('resources/sample.ogv', { audio = false, @@ -535,7 +627,7 @@ end -- love.graphics.newVolumeImage --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.graphics.newVolumeImage = function(test) test:assertObject(love.graphics.newVolumeImage({ 'resources/love.png', 'resources/love2.png', 'resources/love3.png' @@ -548,8 +640,17 @@ end -- love.graphics.validateShader love.test.graphics.validateShader = function(test) - local pixelcode = 'vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { vec4 texturecolor = Texel(tex, texture_coords); return texturecolor * color;}' - local vertexcode = 'vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; }' + local pixelcode = [[ + vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { + vec4 texturecolor = Texel(tex, texture_coords); + return texturecolor * color; + } + ]] + local vertexcode = [[ + vec4 position(mat4 transform_projection, vec4 vertex_position) { + return transform_projection * vertex_position; + } + ]] -- check made up code first local status, _ = love.graphics.validateShader(true, 'nothing here', 'or here') test:assertEquals(false, status, 'check invalid shader code') @@ -829,25 +930,37 @@ end -- love.graphics.isActive love.test.graphics.isActive = function(test) - test:assertEquals(true, love.graphics.isActive(), 'check graphics is active') -- i mean if you got this far + local name, version, vendor, device = love.graphics.getRendererInfo() + if string.find(name, 'Vulkan') ~= nil then + test:skipTest('love.graphics.isActive() crashes on Vulkan') + else + test:assertEquals(true, love.graphics.isActive(), 'check graphics is active') -- i mean if you got this far + end end -- love.graphics.isGammaCorrect love.test.graphics.isGammaCorrect = function(test) -- we know the config so know this is false - test:assertEquals(false, love.graphics.isGammaCorrect(), 'check gamma correct false') + print('gammaCorrect #1') + test:assertNotNil(love.graphics.isGammaCorrect()) + print('gammaCorrect #2') end -- love.graphics.isWireframe love.test.graphics.isWireframe = function(test) - -- check off by default - test:assertEquals(false, love.graphics.isWireframe(), 'check no wireframe by default') - -- check on when enabled - love.graphics.setWireframe(true) - test:assertEquals(true, love.graphics.isWireframe(), 'check wireframe is set') - love.graphics.setWireframe(false) -- reset + local name, version, vendor, device = love.graphics.getRendererInfo() + if string.match(name, 'OpenGL ES') then + test:skipTest('Wireframe not supported on OpenGL ES') + else + -- check off by default + test:assertEquals(false, love.graphics.isWireframe(), 'check no wireframe by default') + -- check on when enabled + love.graphics.setWireframe(true) + test:assertEquals(true, love.graphics.isWireframe(), 'check wireframe is set') + love.graphics.setWireframe(false) -- reset + end end @@ -1193,8 +1306,17 @@ end -- love.graphics.setShader love.test.graphics.setShader = function(test) -- make a shader that will only ever draw yellow - local pixelcode = 'vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { vec4 texturecolor = Texel(tex, texture_coords); return vec4(1.0,1.0,0.0,1.0);}' - local vertexcode = 'vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; }' + local pixelcode = [[ + vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { + vec4 texturecolor = Texel(tex, texture_coords); + return vec4(1.0,1.0,0.0,1.0); + } + ]] + local vertexcode = [[ + vec4 position(mat4 transform_projection, vec4 vertex_position) { + return transform_projection * vertex_position; + } + ]] local shader = love.graphics.newShader(pixelcode, vertexcode) local canvas = love.graphics.newCanvas(16, 16) love.graphics.setCanvas(canvas) @@ -1238,22 +1360,27 @@ end -- love.graphics.setWireframe love.test.graphics.setWireframe = function(test) - -- check wireframe outlines - love.graphics.setWireframe(true) - local canvas = love.graphics.newCanvas(16, 16) - love.graphics.setCanvas(canvas) - love.graphics.clear(0, 0, 0, 1) - love.graphics.setColor(1, 1, 0, 1) - love.graphics.rectangle('fill', 2, 2, 13, 13) - love.graphics.setColor(1, 1, 1, 1) - love.graphics.setWireframe(false) - love.graphics.setCanvas() - local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) - test:assertPixels(imgdata, { - yellow = {{1,14},{14,1},{14,14},{2,2},{13,13}}, - black = {{2,13},{13,2}} - }, 'set wireframe') - test:exportImg(imgdata) + local name, version, vendor, device = love.graphics.getRendererInfo() + if string.match(name, 'OpenGL ES') then + test:skipTest('Wireframe not supported on OpenGL ES') + else + -- check wireframe outlines + love.graphics.setWireframe(true) + local canvas = love.graphics.newCanvas(16, 16) + love.graphics.setCanvas(canvas) + love.graphics.clear(0, 0, 0, 1) + love.graphics.setColor(1, 1, 0, 1) + love.graphics.rectangle('fill', 2, 2, 13, 13) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.setWireframe(false) + love.graphics.setCanvas() + local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + test:assertPixels(imgdata, { + yellow = {{1,14},{14,1},{14,14},{2,2},{13,13}}, + black = {{2,13},{13,2}} + }, 'set wireframe') + test:exportImg(imgdata) + end end diff --git a/testing/tests/image.lua b/testing/tests/image.lua index e0a71d492..5de709a1a 100644 --- a/testing/tests/image.lua +++ b/testing/tests/image.lua @@ -1,6 +1,81 @@ -- love.image +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- CompressedImageData (love.image.newCompressedImageData) +love.test.image.CompressedImageData = function(test) + -- create obj + local idata = love.image.newCompressedData('resources/love.dxt1') + test:assertObject(idata) + -- check data properties + test:assertNotEquals(nil, idata:getString(), 'check data string') + test:assertEquals(2744, idata:getSize(), 'check data size') + -- check img data properties + local iw, ih = idata:getDimensions() + test:assertEquals(64, iw, 'check image dimension w') + test:assertEquals(64, ih, 'check image dimension h') + test:assertEquals('DXT1', idata:getFormat(), 'check image format') + test:assertEquals(64, idata:getWidth(), 'check image direct w') + test:assertEquals(64, idata:getHeight(), 'check image direct h') + test:assertEquals(7, idata:getMipmapCount(), 'check mipmap count') +end + + +-- ImageData (love.image.newImageData) +love.test.image.ImageData = function(test) + -- create obj + local idata = love.image.newImageData('resources/love.png') + test:assertObject(idata) + -- check data properties + test:assertNotEquals(nil, idata:getString(), 'check data string') + test:assertEquals(16384, idata:getSize(), 'check data size') + -- check img data properties + local iw, ih = idata:getDimensions() + test:assertEquals(64, iw, 'check image dimension w') + test:assertEquals(64, ih, 'check image dimension h') + test:assertEquals('rgba8', idata:getFormat(), 'check image format') + test:assertEquals(64, idata:getWidth(), 'check image direct w') + test:assertEquals(64, idata:getHeight(), 'check image direct h') + -- manipulate image data so white heart is black + local mapdata = function(x, y, r, g, b, a) + if r == 1 and g == 1 and b == 1 then + r = 0; g = 0; b = 0 + end + return r, g, b, a + end + idata:mapPixel(mapdata, 0, 0, 64, 64) + local r1, g1, b1 = idata:getPixel(25, 25) + test:assertEquals(0, r1+g1+b1, 'check mapped black') + -- map some other data into the idata + local idata2 = love.image.newImageData('resources/loveinv.png') + idata:paste(idata2, 0, 0, 0, 0) + r1, g1, b1 = idata:getPixel(25, 25) + test:assertEquals(3, r1+g1+b1, 'check back to white') + -- set pixels directly + idata:setPixel(25, 25, 1, 0, 0, 1) + r1, g1, b1 = idata:getPixel(25, 25) + test:assertEquals(1, r1+g1+b1, 'check set to red') + -- check encoding to an image + idata:encode('png', 'test-encode.png') + local read = love.filesystem.openFile('test-encode.png', 'r') + test:assertNotNil(read) + love.filesystem.remove('test-encode.png') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.image.isCompressed -- @NOTE really we need to test each of the files listed here: -- https://love2d.org/wiki/CompressedImageFormat @@ -12,14 +87,14 @@ end -- love.image.newCompressedData --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.image.newCompressedData = function(test) test:assertObject(love.image.newCompressedData('resources/love.dxt1')) end -- love.image.newImageData --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.image.newImageData = function(test) test:assertObject(love.image.newImageData('resources/love.png')) test:assertObject(love.image.newImageData(16, 16, 'rgba8', nil)) diff --git a/testing/tests/math.lua b/testing/tests/math.lua index 51e915728..14b9791c7 100644 --- a/testing/tests/math.lua +++ b/testing/tests/math.lua @@ -1,6 +1,156 @@ -- love.math +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- BezierCurve (love.math.newBezierCurve) +love.test.math.BezierCurve = function(test) + -- create obj + local curve = love.math.newBezierCurve(1, 1, 2, 2, 3, 1) + local px, py = curve:getControlPoint(2) + test:assertObject(curve) + -- check initial properties + test:assertCoords({2, 2}, {px, py}, 'check point x/y') + test:assertEquals(3, curve:getControlPointCount(), 'check 3 points') + test:assertEquals(2, curve:getDegree(), 'check degree is points-1') + -- check some values on the curve + test:assertEquals(1, curve:evaluate(0), 'check curve evaluation 0') + test:assertEquals(120, math.floor(curve:evaluate(0.1)*100), 'check curve evaluation 0.1') + test:assertEquals(140, math.floor(curve:evaluate(0.2)*100), 'check curve evaluation 0.2') + test:assertEquals(200, math.floor(curve:evaluate(0.5)*100), 'check curve evaluation 0.5') + test:assertEquals(3, curve:evaluate(1), 'check curve evaluation 1') + -- check derivative + local deriv = curve:getDerivative() + test:assertObject(deriv) + test:assertEquals(2, deriv:getControlPointCount(), 'check deriv points') + test:assertEquals(200, math.floor(deriv:evaluate(0.1)*100), 'check deriv evaluation 0.1') + -- check segment + local segment = curve:getSegment(0, 0.5) + test:assertObject(segment) + test:assertEquals(3, segment:getControlPointCount(), 'check segment points') + test:assertEquals(109, math.floor(segment:evaluate(0.1)*100), 'check segment evaluation 0.1') + -- mess with control points + curve:removeControlPoint(2) + curve:insertControlPoint(4, 1, -1) + curve:insertControlPoint(5, 3, -1) + curve:insertControlPoint(6, 2, -1) + curve:setControlPoint(2, 3, 2) + test:assertEquals(5, curve:getControlPointCount(), 'check 3 points still') + local px1, py1 = curve:getControlPoint(1) + local px2, py2 = curve:getControlPoint(3) + local px3, py3 = curve:getControlPoint(5) + test:assertCoords({1, 1}, {px1, py1}, 'check modified point 1') + test:assertCoords({5, 3}, {px2, py2}, 'check modified point 1') + test:assertCoords({3, 1}, {px3, py3}, 'check modified point 1') + -- check render lists + local coords1 = curve:render(5) + local coords2 = curve:renderSegment(0, 0.1, 5) + test:assertEquals(196, #coords1, 'check coords') + test:assertEquals(20, #coords2, 'check segment coords') + -- check translation values + px, py = curve:getControlPoint(2) + test:assertCoords({3, 2}, {px, py}, 'check pretransform x/y') + curve:rotate(90 * (math.pi/180), 0, 0) + px, py = curve:getControlPoint(2) + test:assertCoords({-2, 3}, {px, py}, 'check rotated x/y') + curve:scale(2, 0, 0) + px, py = curve:getControlPoint(2) + test:assertCoords({-4, 6}, {px, py}, 'check scaled x/y') + curve:translate(5, -5) + px, py = curve:getControlPoint(2) + test:assertCoords({1, 1}, {px, py}, 'check translated x/y') +end + + +-- RandomGenerator (love.math.RandomGenerator) +-- @NOTE as this checks random numbers the chances this fails is very unlikely, but not 0... +-- if you've managed to proc it congrats! your prize is to rerun the testsuite again +love.test.math.RandomGenerator = function(test) + -- create object + local rng1 = love.math.newRandomGenerator(3418323524, 20529293) + test:assertObject(rng1) + -- check set properties + local low, high = rng1:getSeed() + test:assertEquals(3418323524, low, 'check seed low') + test:assertEquals(20529293, high, 'check seed high') + -- check states + local rng2 = love.math.newRandomGenerator(1448323524, 10329293) + test:assertNotEquals(rng1:random(), rng2:random(), 'check not matching states') + test:assertNotEquals(rng1:randomNormal(), rng2:randomNormal(), 'check not matching states') + -- check setting state works + rng2:setState(rng1:getState()) + test:assertEquals(rng1:random(), rng2:random(), 'check now matching') + -- check overwriting seed works, should change output + rng1:setSeed(os.time()) + test:assertNotEquals(rng1:random(), rng2:random(), 'check not matching states') + test:assertNotEquals(rng1:randomNormal(), rng2:randomNormal(), 'check not matching states') +end + + +-- Transform (love.math.Transform) +love.test.math.Transform = function(test) + -- create obj + local transform = love.math.newTransform(0, 0, 0, 1, 1, 0, 0, 0, 0) + test:assertObject(transform) + -- set some values and check the matrix and transformPoint values + transform:translate(10, 8) + transform:scale(2, 3) + transform:rotate(90*(math.pi/180)) + transform:shear(1, 2) + local px, py = transform:transformPoint(1, 1) + test:assertCoords({4, 14}, {px, py}, 'check transformation methods') + transform:reset() + px, py = transform:transformPoint(1, 1) + test:assertCoords({1, 1}, {px, py}, 'check reset') + -- apply a transform to another transform + local transform2 = love.math.newTransform() + transform2:translate(5, 3) + transform:apply(transform2) + px, py = transform:transformPoint(1, 1) + test:assertCoords({6, 4}, {px, py}, 'check apply other transform') + -- check cloning a transform + local transform3 = transform:clone() + px, py = transform3:transformPoint(1, 1) + test:assertCoords({6, 4}, {px, py}, 'check clone transform') + -- check inverse and inverseTransform + transform:reset() + transform:translate(-14, 6) + local ipx, ipy = transform:inverseTransformPoint(0, 0) + transform:inverse() + px, py = transform:transformPoint(0, 0) + test:assertCoords({-px, -py}, {ipx, ipy}, 'check inverse points transform') + -- check matrix manipulation + transform:setTransformation(0, 0, 0, 1, 1, 0, 0, 0, 0) + transform:translate(4, 4) + local m1, m2, m3, m4, m5, m6, m7, m8, + m9, m10, m11, m12, m13, m14, m15, m16 = transform:getMatrix() + test:assertEquals(4, m4, 'check translate matrix x') + test:assertEquals(4, m8, 'check translate matrix y') + transform:setMatrix(m1, m2, m3, 3, m5, m6, m7, 1, m9, m10, m11, m12, m13, m14, m15, m16) + px, py = transform:transformPoint(1, 1) + test:assertCoords({4, 2}, {px, py}, 'check set matrix') + -- check affine vs non affine + transform:reset() + test:assertEquals(true, transform:isAffine2DTransform(), 'check affine 1') + transform:translate(4, 3) + test:assertEquals(true, transform:isAffine2DTransform(), 'check affine 2') + transform:setMatrix(1, 3, 4, 5.5, 1, 4.5, 2, 1, 3.4, 5.1, 4.1, 13, 1, 1, 2, 3) + test:assertEquals(false, transform:isAffine2DTransform(), 'check not affine') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.math.colorFromBytes love.test.math.colorFromBytes = function(test) -- check random value @@ -98,21 +248,21 @@ end -- love.math.newBezierCurve --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.math.newBezierCurve = function(test) test:assertObject(love.math.newBezierCurve({0, 0, 0, 1, 1, 1, 2, 1})) end -- love.math.newRandomGenerator --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.math.newRandomGenerator = function(test) test:assertObject(love.math.newRandomGenerator()) end -- love.math.newTransform --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.math.newTransform = function(test) test:assertObject(love.math.newTransform()) end diff --git a/testing/tests/objects.lua b/testing/tests/objects.lua deleted file mode 100644 index 2a03544b8..000000000 --- a/testing/tests/objects.lua +++ /dev/null @@ -1,411 +0,0 @@ --- objects put in their own test methods to test all attributes and class methods - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -------------------------------------AUDIO--------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- RecordingDevice (love.audio.getRecordingDevices) -love.test.objects.RecordingDevice = function(test) - test:skipTest('test class needs writing') -end - - --- Source (love.audio.newSource) -love.test.objects.Source = function(test) - test:skipTest('test class needs writing') - -- local source1 = love.audio.newSource('resources/click.ogg', 'static') - --source1:clone() - --source1:getChannelCount() - --source1:getDuration() - --source1:isRelative() - --source1:queue() - --source1:getFreeBufferCount() - --source1:getType() - --source1:isPlaying() - --source1:play() - --source1:pause() - --source1:stop() - --source1:seek() - --source1:tell() - --source1:isLooping() - --source1:setLooping() - --source1:setAirAbsorption() - --source1:getAirAbsorption() - --source1:setAttenuationDistances() - --source1:getAttenuationDistances() - --source1:setCone() - --source1:getCone() - --source1:setDirection() - --source1:getDirection() - --source1:setEffect() - --source1:getEffect() - --source1:getActiveEffects() - --source1:setFilter() - --source1:getFilter() - --source1:setPitch() - --source1:getPitch() - --source1:setPosition() - --source1:getPosition() - --source1:setRelative() - --source1:setRolloff() - --source1:getRolloff() - --source1:setVelocity() - --source1:getVelocity() - --source1:setVolume() - --source1:getVolume() - --source1:setVolumeLimits() - --source1:getVolumeLimits() -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -------------------------------------DATA---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- ByteData (love.data.newByteData) -love.test.objects.ByteData = function(test) - test:skipTest('test class needs writing') -end - - --- CompressedData (love.data.compress) -love.test.objects.CompressedData = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ----------------------------------FILESYSTEM------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- File (love.filesystem.newFile) -love.test.objects.File = function(test) - - -- setup a file to play with - local file1 = love.filesystem.openFile('data.txt', 'w') - file1:write('helloworld') - test:assertObject(file1) - file1:close() - - -- test read mode - file1:open('r') - test:assertEquals('r', file1:getMode(), 'check read mode') - local contents, size = file1:read() - test:assertEquals('helloworld', contents) - test:assertEquals(10, size, 'check file read') - test:assertEquals(10, file1:getSize()) - local ok, err = file1:write('hello') - test:assertNotEquals(nil, err, 'check cant write in read mode') - local iterator = file1:lines() - test:assertNotEquals(nil, iterator, 'check can read lines') - test:assertEquals('data.txt', file1:getFilename(), 'check filename matches') - file1:close() - - -- test write mode - file1:open('w') - test:assertEquals('w', file1:getMode(), 'check write mode') - contents, size = file1:read() - test:assertEquals(nil, contents, 'check cant read file in write mode') - test:assertEquals('string', type(size), 'check err message shown') - ok, err = file1:write('helloworld') - test:assertEquals(true, ok, 'check file write') - test:assertEquals(nil, err, 'check no err writing') - - -- test open/closing - file1:open('r') - test:assertEquals(true, file1:isOpen(), 'check file is open') - file1:close() - test:assertEquals(false, file1:isOpen(), 'check file gets closed') - file1:close() - - -- test buffering - -- @NOTE think I'm just not understanding how this is supposed to work? - -- I thought if buffering is enabled then nothing should get written until - -- buffer overflows? - -- file1:open('a') - -- ok, err = file1:setBuffer('full', 10000) - -- test:assertEquals(true, ok) - -- test:assertEquals('full', file1:getBuffer()) - -- file1:write('morecontent') - -- file1:close() - -- file1:open('r') - -- contents, size = file1:read() - -- test:assertEquals('helloworld', contents, 'check buffered content wasnt written') - -- file1:close() - - -- @NOTE :close() commits buffer content so need to check before not after - - -- test buffering and flushing - file1:open('w') - ok, err = file1:setBuffer('full', 10000) - test:assertEquals(true, ok) - test:assertEquals('full', file1:getBuffer()) - file1:write('replacedcontent') - file1:flush() - file1:close() - file1:open('r') - contents, size = file1:read() - test:assertEquals('replacedcontent', contents, 'check buffered content was written') - file1:close() - - -- loop through file data with seek/tell until EOF - file1:open('r') - local counter = 0 - for i=1,100 do - file1:seek(i) - test:assertEquals(i, file1:tell()) - if file1:isEOF() == true then - counter = i - break - end - end - test:assertEquals(counter, 15) - file1:close() - -end - - --- FileData (love.filesystem.newFileData) -love.test.objects.FileData = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -------------------------------------FONT---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- GlyphData (love.font.newGlyphData) -love.test.objects.GlyphData = function(test) - test:skipTest('test class needs writing') -end - - --- Rasterizer (love.font.newRasterizer) -love.test.objects.Rasterizer = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ----------------------------------GRAPHICS--------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Canvas (love.graphics.newCanvas) -love.test.objects.Canvas = function(test) - test:skipTest('test class needs writing') -end - - --- Font (love.graphics.newFont) -love.test.objects.Font = function(test) - test:skipTest('test class needs writing') -end - - --- Image (love.graphics.newImage) -love.test.objects.Image = function(test) - test:skipTest('test class needs writing') -end - - --- Mesh (love.graphics.newMesh) -love.test.objects.Mesh = function(test) - test:skipTest('test class needs writing') -end - - --- ParticleSystem (love.graphics.newParticleSystem) -love.test.objects.ParticleSystem = function(test) - test:skipTest('test class needs writing') -end - - --- Quad (love.graphics.newQuad) -love.test.objects.Quad = function(test) - test:skipTest('test class needs writing') -end - - --- Shader (love.graphics.newShader) -love.test.objects.Shader = function(test) - test:skipTest('test class needs writing') -end - - --- SpriteBatch (love.graphics.newSpriteBatch) -love.test.objects.SpriteBatch = function(test) - test:skipTest('test class needs writing') -end - - --- Text (love.graphics.newTextBatch) -love.test.objects.Text = function(test) - test:skipTest('test class needs writing') -end - - --- Texture (love.graphics.newTexture) -love.test.objects.Texture = function(test) - test:skipTest('test class needs writing') -end - - --- Video (love.graphics.newVideo) -love.test.objects.Video = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ------------------------------------IMAGE---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- CompressedImageData (love.image.newCompressedImageData) -love.test.objects.CompressedImageData = function(test) - test:skipTest('test class needs writing') -end - - --- ImageData (love.image.newImageData) -love.test.objects.ImageData = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -------------------------------------MATH---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- BezierCurve (love.math.newBezierCurve) -love.test.objects.BezierCurve = function(test) - test:skipTest('test class needs writing') -end - - --- RandomGenerator (love.math.RandomGenerator) -love.test.objects.RandomGenerator = function(test) - test:skipTest('test class needs writing') -end - - --- Transform (love.math.Transform) -love.test.objects.Transform = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -----------------------------------PHYSICS--------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Body (love.physics.newBody) -love.test.objects.Body = function(test) - test:skipTest('test class needs writing') -end - - --- Contact (love.physics.World:getContacts) -love.test.objects.Contact = function(test) - test:skipTest('test class needs writing') -end - - --- Fixture (love.physics.newFixture) -love.test.objects.Fixture = function(test) - test:skipTest('test class needs writing') -end - - --- Joint (love.physics.newDistanceJoint) -love.test.objects.Joint = function(test) - test:skipTest('test class needs writing') -end - - --- Shape (love.physics.newCircleShape) -love.test.objects.Shape = function(test) - test:skipTest('test class needs writing') -end - - --- World (love.physics.newWorld) -love.test.objects.World = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ------------------------------------SOUND---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Decoder (love.sound.newDecoder) -love.test.objects.Decoder = function(test) - test:skipTest('test class needs writing') -end - - --- SoundData (love.sound.newSoundData) -love.test.objects.SoundData = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -----------------------------------THREAD---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Channel (love.thread.newChannel) -love.test.objects.Channel = function(test) - test:skipTest('test class needs writing') -end - - --- Thread (love.thread.newThread) -love.test.objects.Thread = function(test) - test:skipTest('test class needs writing') -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ------------------------------------VIDEO---------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- VideoStream (love.thread.newVideoStream) -love.test.objects.VideoStream = function(test) - test:skipTest('test class needs writing') -end diff --git a/testing/tests/physics.lua b/testing/tests/physics.lua index 87b99da3b..929bbf0e6 100644 --- a/testing/tests/physics.lua +++ b/testing/tests/physics.lua @@ -1,6 +1,56 @@ -- love.physics +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------OBJECTS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Body (love.physics.newBody) +love.test.physics.Body = function(test) + test:skipTest('test class needs writing') +end + + +-- Contact (love.physics.World:getContacts) +love.test.physics.Contact = function(test) + test:skipTest('test class needs writing') +end + + +-- Fixture (love.physics.newFixture) +love.test.physics.Fixture = function(test) + test:skipTest('test class needs writing') +end + + +-- Joint (love.physics.newDistanceJoint) +love.test.physics.Joint = function(test) + test:skipTest('test class needs writing') +end + + +-- Shape (love.physics.newCircleShape) +love.test.physics.Shape = function(test) + test:skipTest('test class needs writing') +end + + +-- World (love.physics.newWorld) +love.test.physics.World = function(test) + test:skipTest('test class needs writing') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.physics.getDistance love.test.physics.getDistance = function(test) -- setup two fixtues to check @@ -24,7 +74,7 @@ end -- love.physics.newBody --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newBody = function(test) local world = love.physics.newWorld(1, 1, true) local body = love.physics.newBody(world, 10, 10, 'static') @@ -33,21 +83,21 @@ end -- love.physics.newChainShape --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newChainShape = function(test) test:assertObject(love.physics.newChainShape(true, 0, 0, 1, 0, 1, 1, 0, 1)) end -- love.physics.newCircleShape --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newCircleShape = function(test) test:assertObject(love.physics.newCircleShape(10)) end -- love.physics.newDistanceJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newDistanceJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -58,7 +108,7 @@ end -- love.physics.newEdgeShape --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newEdgeShape = function(test) local obj = love.physics.newEdgeShape(0, 0, 10, 10) test:assertObject(obj) @@ -66,7 +116,7 @@ end -- love.physics.newFixture --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newFixture = function(test) local world = love.physics.newWorld(1, 1, true) local body = love.physics.newBody(world, 10, 10, 'static') @@ -77,7 +127,7 @@ end -- love.physics.newFrictionJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newFrictionJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -88,7 +138,7 @@ end -- love.physics.newGearJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newGearJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'dynamic') @@ -103,7 +153,7 @@ end -- love.physics.newMotorJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newMotorJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -114,7 +164,7 @@ end -- love.physics.newMouseJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newMouseJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body = love.physics.newBody(world, 10, 10, 'static') @@ -124,7 +174,7 @@ end -- love.physics.newPolygonShape --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newPolygonShape = function(test) local obj = love.physics.newPolygonShape({0, 0, 2, 3, 2, 1, 3, 1, 5, 1}) test:assertObject(obj) @@ -132,7 +182,7 @@ end -- love.physics.newPrismaticJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newPrismaticJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -143,7 +193,7 @@ end -- love.physics.newPulleyJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newPulleyJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -154,7 +204,7 @@ end -- love.physics.newRectangleShape --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newRectangleShape = function(test) local shape1 = love.physics.newRectangleShape(10, 20) local shape2 = love.physics.newRectangleShape(10, 10, 40, 30, 10) @@ -164,7 +214,7 @@ end -- love.physics.newRevoluteJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newRevoluteJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -175,7 +225,7 @@ end -- love.physics.newRopeJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newRopeJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -186,7 +236,7 @@ end -- love.physics.newWeldJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newWeldJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -197,7 +247,7 @@ end -- love.physics.newWheelJoint --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newWheelJoint = function(test) local world = love.physics.newWorld(1, 1, true) local body1 = love.physics.newBody(world, 10, 10, 'static') @@ -208,7 +258,7 @@ end -- love.physics.newWorld --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.physics.newWorld = function(test) local world = love.physics.newWorld(1, 1, true) test:assertObject(world) diff --git a/testing/tests/sound.lua b/testing/tests/sound.lua index 88d3398ba..887aabf0b 100644 --- a/testing/tests/sound.lua +++ b/testing/tests/sound.lua @@ -1,15 +1,81 @@ -- love.sound +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------OBJECTS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Decoder (love.sound.newDecoder) +love.test.sound.Decoder = function(test) + -- create obj + local decoder = love.sound.newDecoder('resources/click.ogg') + test:assertObject(decoder) + -- check decoder props + test:assertMatch({8, 16}, decoder:getBitDepth(), 'check bit depth') + test:assertMatch({1, 2}, decoder:getChannelCount(), 'check channel count') + test:assertEquals(66, math.floor(decoder:getDuration()*1000), 'check duration') + test:assertEquals(44100, decoder:getSampleRate(), 'check sample rate') + -- check makes sound data (test in method below) + test:assertObject(decoder:decode()) + -- check cloning sound + local clone = decoder:clone() + test:assertMatch({8, 16}, clone:getBitDepth(), 'check cloned bit depth') + test:assertMatch({1, 2}, clone:getChannelCount(), 'check cloned channel count') + test:assertEquals(66, math.floor(clone:getDuration()*1000), 'check cloned duration') + test:assertEquals(44100, clone:getSampleRate(), 'check cloned sample rate') +end + + +-- SoundData (love.sound.newSoundData) +love.test.sound.SoundData = function(test) + -- create obj + local sdata = love.sound.newSoundData('resources/click.ogg') + test:assertObject(sdata) + -- check data props + test:assertEquals(11708, sdata:getSize(), 'check size') + test:assertNotNil(sdata:getString()) + test:assertMatch({8, 16}, sdata:getBitDepth(), 'check bit depth') + test:assertMatch({1, 2}, sdata:getChannelCount(), 'check channel count') + test:assertEquals(66, math.floor(sdata:getDuration()*1000), 'check duration') + test:assertEquals(44100, sdata:getSampleRate(), 'check sample rate') + test:assertEquals(2927, sdata:getSampleCount(), 'check sample count') + -- check cloning + local clone = sdata:clone() + test:assertEquals(11708, clone:getSize(), 'check clone size') + test:assertNotNil(clone:getString()) + test:assertMatch({8, 16}, clone:getBitDepth(), 'check clone bit depth') + test:assertMatch({1, 2}, clone:getChannelCount(), 'check clone channel count') + test:assertEquals(66, math.floor(clone:getDuration()*1000), 'check clone duration') + test:assertEquals(44100, clone:getSampleRate(), 'check clone sample rate') + test:assertEquals(2927, clone:getSampleCount(), 'check clone sample count') + -- check sample setting + test:assertEquals(-22, math.floor(sdata:getSample(0.001)*100000), 'check sample 1') + test:assertEquals(-22, math.floor(sdata:getSample(0.005)*100000), 'check sample 1') + sdata:setSample(0.002, 1) + test:assertEquals(1, sdata:getSample(0.002), 'check setting sample manually') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +------------------------------------METHODS------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + + -- love.sound.newDecoder --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.sound.newDecoder = function(test) test:assertObject(love.sound.newDecoder('resources/click.ogg')) end -- love.sound.newSoundData --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.sound.newSoundData = function(test) test:assertObject(love.sound.newSoundData('resources/click.ogg')) test:assertObject(love.sound.newSoundData(math.floor((1/32)*44100), 44100, 16, 1)) diff --git a/testing/tests/system.lua b/testing/tests/system.lua index 432352ec5..e8ef4229c 100644 --- a/testing/tests/system.lua +++ b/testing/tests/system.lua @@ -1,6 +1,13 @@ -- love.system +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------METHODS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.system.getClipboardText love.test.system.getClipboardText = function(test) -- ignore if not using window diff --git a/testing/tests/thread.lua b/testing/tests/thread.lua index 8bbcab62f..8714ffeda 100644 --- a/testing/tests/thread.lua +++ b/testing/tests/thread.lua @@ -1,22 +1,124 @@ -- love.thread +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------OBJECTS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Channel (love.thread.newChannel) +love.test.thread.Channel = function(test) + -- create channel + local channel = love.thread.getChannel('test') + test:assertObject(channel) + -- setup thread to use + local threadcode1 = [[ + require("love.timer") + love.timer.sleep(0.1) + love.thread.getChannel('test'):push('hello world') + love.timer.sleep(0.1) + love.thread.getChannel('test'):push('me again') + ]] + local thread1 = love.thread.newThread(threadcode1) + thread1:start() + -- check message sent from thread to channel + local msg1 = channel:demand() + test:assertEquals('hello world', msg1, 'check 1st message was sent') + thread1:wait() + test:assertEquals(1, channel:getCount(), 'check still another message') + test:assertEquals('me again', channel:peek(), 'check 2nd message pending') + local msg2 = channel:pop() + test:assertEquals('me again', msg2, 'check 2nd message was sent') + channel:clear() + -- setup another thread for some ping pong + local threadcode2 = [[ + local function setChannel(channel, value) + channel:clear() + return channel:push(value) + end + local channel = love.thread.getChannel('test') + local waiting = true + local sent = nil + while waiting == true do + if sent == nil then + sent = channel:performAtomic(setChannel, 'ping') + end + if channel:hasRead(sent) then + local msg = channel:demand() + if msg == 'pong' then + channel:push(msg) + waiting = false + end + end + end + ]] + -- first we run a thread that will send 1 ping + local thread2 = love.thread.newThread(threadcode2) + thread2:start() + -- we wait for that ping to be sent and then send a pong back + local msg3 = channel:demand() + test:assertEquals('ping', msg3, 'check message recieved 1') + -- thread should be waiting for us, and checking is the ping was read + channel:supply('pong', 1) + -- if it was then it should send back our pong and thread should die + thread2:wait() + local msg4 = channel:pop() + test:assertEquals('pong', msg4, 'check message recieved 2') + test:assertEquals(0, channel:getCount()) +end + + +-- Thread (love.thread.newThread) +love.test.thread.Thread = function(test) + -- create thread + local threadcode = [[ + local b = 0 + for a=1,100000 do + b = b + a + end + ]] + local thread = love.thread.newThread(threadcode) + test:assertObject(thread) + -- check thread runs + thread:start() + test:assertEquals(true, thread:isRunning(), 'check started') + thread:wait() + test:assertEquals(false, thread:isRunning(), 'check finished') + test:assertEquals(nil, thread:getError(), 'check no errors') + -- check an invalid thread + local badthreadcode = 'local b = 0\nreturn b + "string" .. 10' + local badthread = love.thread.newThread(badthreadcode) + badthread:start() + badthread:wait() + test:assertNotNil(badthread:getError()) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------METHODS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.thread.getChannel --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.thread.getChannel = function(test) test:assertObject(love.thread.getChannel('test')) end -- love.thread.newChannel --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.thread.newChannel = function(test) test:assertObject(love.thread.newChannel()) end -- love.thread.newThread --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.thread.newThread = function(test) test:assertObject(love.thread.newThread('classes/TestSuite.lua')) end diff --git a/testing/tests/timer.lua b/testing/tests/timer.lua index ca82449d3..3fd1b5b53 100644 --- a/testing/tests/timer.lua +++ b/testing/tests/timer.lua @@ -1,6 +1,13 @@ -- love.timer +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------METHODS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.timer.getAverageDelta -- @NOTE not sure if you could reliably get a specific delta? love.test.timer.getAverageDelta = function(test) diff --git a/testing/tests/video.lua b/testing/tests/video.lua index a67aaac11..06b4eea7c 100644 --- a/testing/tests/video.lua +++ b/testing/tests/video.lua @@ -1,8 +1,42 @@ -- love.video +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------OBJECTS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- VideoStream (love.thread.newVideoStream) +love.test.video.VideoStream = function(test) + -- create obj + local video = love.video.newVideoStream('resources/sample.ogv') + test:assertObject(video) + -- check def properties + test:assertEquals('resources/sample.ogv', video:getFilename(), 'check filename') + test:assertEquals(false, video:isPlaying(), 'check not playing by def') + -- check playing and pausing + video:play() + test:assertEquals(true, video:isPlaying(), 'check now playing') + video:seek(0.3) + test:assertEquals(0.3, video:tell(), 'check seek/tell') + video:rewind() + test:assertEquals(0, video:tell(), 'check rewind') + video:pause() + test:assertEquals(false, video:isPlaying(), 'check paused') +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------METHODS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.video.newVideoStream --- @NOTE this is just basic nil checking, full obj test are in objects.lua +-- @NOTE this is just basic nil checking, objs have their own test method love.test.video.newVideoStream = function(test) test:assertObject(love.video.newVideoStream('resources/sample.ogv')) end diff --git a/testing/tests/window.lua b/testing/tests/window.lua index ae2cfdb9e..44d21a235 100644 --- a/testing/tests/window.lua +++ b/testing/tests/window.lua @@ -1,6 +1,13 @@ -- love.window +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----------------------------------METHODS--------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + -- love.window.close love.test.window.close = function(test) -- closing window should cause graphics to not be active @@ -130,12 +137,6 @@ end -- love.window.getVSync love.test.window.getVSync = function(test) test:assertNotNil(love.window.getVSync()) - -- check turning off - love.window.setVSync(0) - test:assertEquals(0, love.window.getVSync(), 'check vsync off') - -- check turning on - love.window.setVSync(1) - test:assertEquals(1, love.window.getVSync(), 'check vsync on') end @@ -168,6 +169,7 @@ end -- love.window.isMaximized love.test.window.isMaximized = function(test) if test:isDelayed() == false then + test:assertEquals(false, love.window.isMaximized(), 'check window not maximized') love.window.maximize() test:setDelay(10) else @@ -180,12 +182,17 @@ end -- love.window.isMinimized love.test.window.isMinimized = function(test) - -- check not minimized to start - test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') - -- try to minimize - love.window.minimize() - test:assertEquals(true, love.window.isMinimized(), 'check window minimized') - love.window.restore() + if test:isDelayed() == false then + -- check not minimized to start + test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') + -- try to minimize + love.window.minimize() + test:setDelay(10) + else + -- on linux minimize won't get recognized immediately, so wait a few frames + test:assertEquals(true, love.window.isMinimized(), 'check window minimized') + love.window.restore() + end end @@ -214,6 +221,7 @@ end -- love.window.maximize love.test.window.maximize = function(test) if test:isDelayed() == false then + test:assertEquals(false, love.window.isMaximized(), 'check window not maximized') -- check maximizing is set love.window.maximize() test:setDelay(10) @@ -227,10 +235,16 @@ end -- love.window.minimize love.test.window.minimize = function(test) - -- check minimizing is set - love.window.minimize() - test:assertEquals(true, love.window.isMinimized(), 'check window minimized') - love.window.restore() + if test:isDelayed() == false then + test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') + -- check minimizing is set + love.window.minimize() + test:setDelay(10) + else + -- on linux we need to wait a few frames + test:assertEquals(true, love.window.isMinimized(), 'check window maximized') + love.window.restore() + end end @@ -242,12 +256,20 @@ end -- love.window.restore love.test.window.restore = function(test) - -- check minimized to start - love.window.minimize() - test:assertEquals(true, love.window.isMinimized(), 'check window minimized') - -- check restoring the state of the window - love.window.restore() - test:assertEquals(false, love.window.isMinimized(), 'check window restored') + + -- TODO: for linux runner + -- test doesn't pass because the current test delay system can't wait twice + + if test:isDelayed() == false then + -- check minimized to start + love.window.minimize() + love.window.restore() + test:setDelay(10) + else + -- check restoring the state of the window + test:assertEquals(false, love.window.isMinimized(), 'check window restored') + end + end @@ -305,11 +327,15 @@ end -- love.window.setPosition love.test.window.setPosition = function(test) - -- check position is returned - love.window.setPosition(100, 100, 1) - local x, y, _ = love.window.getPosition() - test:assertEquals(100, x, 'check position x') - test:assertEquals(100, y, 'check position y') + if test:isDelayed() == false then + -- check position is returned + love.window.setPosition(100, 100, 1) + test:setDelay(10) + else + local x, y, _ = love.window.getPosition() + test:assertEquals(100, x, 'check position x') + test:assertEquals(100, y, 'check position y') + end end @@ -324,12 +350,8 @@ end -- love.window.setVSync love.test.window.setVSync = function(test) - -- check setting vsync value off love.window.setVSync(0) - test:assertEquals(0, love.window.getVSync(), 'check vsync off') - -- check setting vsync value on - love.window.setVSync(1) - test:assertEquals(1, love.window.getVSync(), 'check vsync on') + test:assertNotNil(love.window.getVSync()) end diff --git a/testing/todo.md b/testing/todo.md index a212b2ab1..b84d8d527 100644 --- a/testing/todo.md +++ b/testing/todo.md @@ -1,31 +1,26 @@ `/Applications/love_12.app/Contents/MacOS/love ./testing` -## TESTSUITE -- [ ] move object methods to respective modules -- [ ] start object methods -- [ ] setStencilMode to replace setStencilTest +## GENERAL +- [ ] check 12.0 wiki page for new methods +- [ ] change delay system to use coroutines +- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) + +## OBJECT TESTS +- [ ] physics.Body, physics.Contact, physics.Fixture, + physics.Joint, physics.Shape, physics.World +- [ ] threads.Channel, threads.Thread + +## METHOD TESTS +- [ ] event.wait +- [ ] graphics.present +- [ ] graphics.drawInstanced + +## DEPRECATED +- [ ] deprecated setStencilTest (use setStencilMode) +- [ ] deprecated physics methods -## GRAPHICS +## GRAPHIC TESTS Methods that need a actual graphic pixel checks if possible: - [ ] setDepthMode - [ ] setFrontFaceWinding - [ ] setMeshCullMode -- [ ] present -- [ ] drawInstanced - -## FUTURE -- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) -- [ ] use coroutines for the delay action? i.e. wrap each test call in coroutine -- [ ] could nil check some joystick and keyboard methods? - -## GITHUB ACTION CI -- [ ] linux needs to run xvfb-run with the appimage -- [ ] try vulkan on windows/linux -- [ ] ios test run? - -## NOTES -Can't run --renderers metal on github action images: -Run love-macos/love.app/Contents/MacOS/love testing --renderers metal -Cannot create Metal renderer: Metal is not supported on this system. -Cannot create graphics: no supported renderer on this system. -Error: Cannot create graphics: no supported renderer on this system. From 658c75b5c3478d1d3e43938371db7fec4f30d611 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:47:36 +0000 Subject: [PATCH 20/54] latest from love-test --- .github/workflows/main.yml | 11 + testing/classes/TestMethod.lua | 13 +- testing/classes/TestModule.lua | 2 - testing/classes/TestSuite.lua | 52 +- testing/examples/lovetest_runAllTests.html | 2 +- testing/examples/lovetest_runAllTests.md | 43 +- testing/examples/lovetest_runAllTests.xml | 533 ++++++++++----------- testing/readme.md | 26 +- testing/resources/alsoft.conf | 489 ++++++++++++++++++- testing/tests/audio.lua | 54 +-- testing/tests/graphics.lua | 55 ++- testing/tests/window.lua | 104 ++-- testing/todo.md | 26 - 13 files changed, 930 insertions(+), 480 deletions(-) delete mode 100644 testing/todo.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ce1d327b..57c697ac4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -311,33 +311,40 @@ jobs: title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl path: testing/output/lovetest_runAllTests.md - name: Zip Test Output (opengl) + if: steps.vars.outputs.arch != 'ARM64' run: | 7z a -tzip test-output-windows-opengl.zip testing/output/ - name: Artifact Test Output (opengl) + if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 with: name: test-output-windows-opengl path: test-output-windows-opengl.zip # windows opengles test - name: Run Tests (opengles) + if: steps.vars.outputs.arch != 'ARM64' run: | $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 powershell.exe ./install/lovec.exe ./testing/main.lua - name: Love Test Report (opengles) + if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: name: Love Testsuite Windows (opengles) title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles path: testing/output/lovetest_runAllTests.md - name: Zip Test Output (opengles) + if: steps.vars.outputs.arch != 'ARM64' run: | 7z a -tzip test-output-windows-opengles.zip testing/output/ - name: Artifact Test Output (opengles) + if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 with: name: test-output-windows-opengles path: test-output-windows-opengles.zip - name: Install Vulkan + if: steps.vars.outputs.arch != 'ARM64' run: | curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma @@ -350,19 +357,23 @@ jobs: powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary # windows vulkan tests - name: Run Tests (vulkan) + if: steps.vars.outputs.arch != 'ARM64' run: | $ENV:LOVE_GRAPHICS_DEBUG=1 powershell.exe ./install/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan - name: Love Test Report (vulkan) + if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: name: Love Testsuite Windows (vulkan) title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan path: testing/output/lovetest_runAllTests.md - name: Zip Test Output (vulkan) + if: steps.vars.outputs.arch != 'ARM64' run: | 7z a -tzip test-output-windows-vulkan.zip testing/output - name: Artifact Test Output (vulkan) + if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 with: name: test-output-windows-vulkan diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua index 4c7705693..a89ba2035 100644 --- a/testing/classes/TestMethod.lua +++ b/testing/classes/TestMethod.lua @@ -42,7 +42,8 @@ TestMethod = { imgs = 1, delay = 0, delayed = false, - store = {} + store = {}, + co = nil } setmetatable(test, self) self.__index = self @@ -281,14 +282,8 @@ TestMethod = { end, - -- currently unused - setDelay = function(self, frames) - self.delay = frames - self.delayed = true - love.test.delayed = self - end, - isDelayed = function(self) - return self.delayed + waitFrames = function(self, frames) + for i=1,frames do coroutine.yield() end end, diff --git a/testing/classes/TestModule.lua b/testing/classes/TestModule.lua index dae7d82ed..f66d247ed 100644 --- a/testing/classes/TestModule.lua +++ b/testing/classes/TestModule.lua @@ -10,9 +10,7 @@ TestModule = { -- @return {table} - returns the new Suite object new = function(self, module, method) local testmodule = { - timer = 0, time = 0, - delay = 0.01, spacer = ' ', colors = { PASS = 'green', FAIL = 'red', SKIP = 'grey' diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 4ac04a4be..39c76b472 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -59,9 +59,7 @@ TestSuite = { -- stagger between tests if self.module ~= nil then - self.module.timer = self.module.timer + delta - if self.module.timer >= self.module.delay then - self.module.timer = self.module.timer - self.module.delay + if self.module.start == true then -- work through each test method 1 by 1 @@ -74,43 +72,25 @@ TestSuite = { self.test = TestMethod:new(method, self.module) TextRun:set('love.' .. self.module.module .. '.' .. method) - -- check method exists in love first - if love[self.module.module] == nil then - local tested = 'love.' .. self.module.module .. '.' .. method .. '()' - local matching = string.sub(self.module.spacer, string.len(tested), 40) - self.module:log(self.module.colors['FAIL'], - tested .. matching, - ' ==> FAIL (0/0) - call failed - method does not exist' - ) - -- otherwise run the test method - else - local ok, chunk, err = pcall(self[self.module.module][method], self.test) + 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 - self.test.passed = false - self.test.fatal = tostring(chunk) .. tostring(err) + love.test.test.passed = false + love.test.test.fatal = tostring(chunk) .. tostring(err) end - end + end) - -- once we've run check delay + eval + + -- once called we have a corouting, so just call resume every frame + -- until we have finished else - -- @TODO use coroutines? - -- if we have a test method that needs a delay - -- we wait for the delay to run out first - if self.delayed ~= nil then - self.delayed.delay = self.delayed.delay - 1 - -- re-run the test method again when delay ends - -- its up to the test to handle the :isDelayed() property - if self.delayed.delay <= 0 then - local ok, chunk, err = pcall(self[self.module.module][self.delayed.method], self.test) - if ok == false then - self.test.passed = false - self.test.fatal = tostring(chunk) .. tostring(err) - end - self.delayed = nil - end - else + -- move onto next yield if any + -- pauses can be set with TestMethod:waitFrames(frames) + coroutine.resume(self.test.co) + -- when wait finished (or no yields) + if coroutine.status(self.test.co) == 'dead' then -- now we're all done evaluate the test local ok, chunk, err = pcall(self.test.evaluateTest, self.test) if ok == false then @@ -118,11 +98,9 @@ TestSuite = { self.test.fatal = tostring(chunk) .. tostring(err) end -- save having to :release() anything we made in the last test - -- 7251ms > 7543ms collectgarbage("collect") -- move onto the next test self.module.index = self.module.index + 1 - end end @@ -148,7 +126,7 @@ TestSuite = { end end end - end + end, diff --git a/testing/examples/lovetest_runAllTests.html b/testing/examples/lovetest_runAllTests.html index 641d05999..5a0be8304 100644 --- a/testing/examples/lovetest_runAllTests.html +++ b/testing/examples/lovetest_runAllTests.html @@ -1 +1 @@ -

🔴 love.test

  • 🟢 254 Tests
  • 🔴 1 Failures
  • 🟡 50 Skipped
  • 12.195s


🟢 love.audio

  • 🟢 26 Tests
  • 🔴 0 Failures
  • 🟡 2 Skipped
  • 0.473s


    • MethodTimeDetails
      🟡RecordingDevice0.024stest class needs writing
      🟡Source0.017stest class needs writing
      🟢getActiveEffects0.016s
      🟢getActiveSourceCount0.016s
      🟢getDistanceModel0.017s
      🟢getDopplerScale0.016s
      🟢getEffect0.016s
      🟢getMaxSceneEffects0.017s
      🟢getMaxSourceEffects0.015s
      🟢getOrientation0.017s
      🟢getPosition0.017s
      🟢getRecordingDevices0.017s
      🟢getVelocity0.016s
      🟢getVolume0.017s
      🟢isEffectsSupported0.016s
      🟢newQueueableSource0.015s
      🟢newSource0.014s
      🟢pause0.016s
      🟢play0.017s
      🟢setDistanceModel0.019s
      🟢setDopplerScale0.017s
      🟢setEffect0.017s
      🟢setMixWithSystem0.017s
      🟢setOrientation0.017s
      🟢setPosition0.018s
      🟢setVelocity0.017s
      🟢setVolume0.016s
      🟢stop0.018s

      🟢 love.data

      • 🟢 7 Tests
      • 🔴 0 Failures
      • 🟡 5 Skipped
      • 0.212s


        • MethodTimeDetails
          🟡ByteData0.016stest class needs writing
          🟡CompressedData0.017stest class needs writing
          🟢compress0.017s
          🟢decode0.018s
          🟢decompress0.018s
          🟢encode0.019s
          🟡getPackedSize0.019stest class needs writing
          🟢hash0.017s
          🟢newByteData0.017s
          🟢newDataView0.017s
          🟡pack0.018stest class needs writing
          🟡unpack0.018stest class needs writing

          🟢 love.event

          • 🟢 4 Tests
          • 🔴 0 Failures
          • 🟡 2 Skipped
          • 0.108s


            • MethodTimeDetails
              🟢clear0.017s
              🟢poll0.017s
              🟡pump0.019snot sure can be tested as used internally
              🟢push0.018s
              🟢quit0.019s
              🟡wait0.018stest class needs writing

              🟢 love.filesystem

              • 🟢 28 Tests
              • 🔴 0 Failures
              • 🟡 3 Skipped
              • 0.556s


                • MethodTimeDetails
                  🟢File0.017s
                  🟡FileData0.019stest class needs writing
                  🟢append0.019s
                  🟢areSymlinksEnabled0.017s
                  🟢createDirectory0.017s
                  🟢getAppdataDirectory0.018s
                  🟢getCRequirePath0.017s
                  🟢getDirectoryItems0.018s
                  🟢getIdentity0.019s
                  🟢getInfo0.019s
                  🟢getRealDirectory0.018s
                  🟢getRequirePath0.018s
                  🟢getSaveDirectory0.018s
                  🟡getSource0.018snot sure can be tested as used internally
                  🟢getSourceBaseDirectory0.018s
                  🟢getUserDirectory0.019s
                  🟢getWorkingDirectory0.019s
                  🟢isFused0.017s
                  🟢lines0.018s
                  🟢load0.016s
                  🟢mount0.019s
                  🟢newFileData0.018s
                  🟢openFile0.019s
                  🟢read0.017s
                  🟢remove0.018s
                  🟢setCRequirePath0.018s
                  🟢setIdentity0.018s
                  🟢setRequirePath0.018s
                  🟡setSource0.018snot sure can be tested as used internally
                  🟢unmount0.018s
                  🟢write0.019s

                  🟢 love.font

                  • 🟢 4 Tests
                  • 🔴 0 Failures
                  • 🟡 3 Skipped
                  • 0.127s


                    • MethodTimeDetails
                      🟡GlyphData0.017stest class needs writing
                      🟡Rasterizer0.018stest class needs writing
                      🟡newBMFontRasterizer0.018swiki and source dont match, not sure expected usage
                      🟢newGlyphData0.020s
                      🟢newImageRasterizer0.020s
                      🟢newRasterizer0.018s
                      🟢newTrueTypeRasterizer0.017s

                      🔴 love.graphics

                      • 🟢 91 Tests
                      • 🔴 1 Failures
                      • 🟡 15 Skipped
                      • 2.091s


                        • MethodTimeDetails
                          🟡Canvas0.016stest class needs writing
                          🟡Font0.017stest class needs writing
                          🟡Image0.019stest class needs writing
                          🟡Mesh0.019stest class needs writing
                          🟡ParticleSystem0.017stest class needs writing
                          🟡Quad0.019stest class needs writing
                          🟡Shader0.018stest class needs writing
                          🟡SpriteBatch0.018stest class needs writing
                          🟡Text0.018stest class needs writing
                          🟡Texture0.018stest class needs writing
                          🟡Video0.019stest class needs writing
                          🟢applyTransform0.018s

                          Expected

                          Actual

                          🟢arc0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢captureScreenshot0.183s
                          🟢circle0.017s

                          Expected

                          Actual

                          🟢clear0.017s

                          Expected

                          Actual

                          🟡discard0.017scant test this worked
                          🟢draw0.018s

                          Expected

                          Actual

                          🟡drawInstanced0.020stest class needs writing
                          🟢drawLayer0.018s

                          Expected

                          Actual

                          🟢ellipse0.018s

                          Expected

                          Actual

                          🟡flushBatch0.018snot sure can be tested as used internally
                          🟢getBackgroundColor0.018s
                          🟢getBlendMode0.018s
                          🟢getCanvas0.018s
                          🟢getColor0.017s
                          🟢getColorMask0.018s
                          🟢getDPIScale0.019s
                          🟢getDefaultFilter0.018s
                          🟢getDepthMode0.018s
                          🟢getDimensions0.017s
                          🟢getFont0.018s
                          🟢getFrontFaceWinding0.019s
                          🟢getHeight0.017s
                          🟢getLineJoin0.018s
                          🟢getLineStyle0.017s
                          🟢getLineWidth0.019s
                          🟢getMeshCullMode0.018s
                          🟢getPixelDimensions0.018s
                          🟢getPixelHeight0.018s
                          🟢getPixelWidth0.018s
                          🟢getPointSize0.019s
                          🟢getRendererInfo0.018s
                          🟢getScissor0.018s
                          🟢getShader0.018s
                          🟢getStackDepth0.018s
                          🟢getStats0.017s
                          🟢getStencilMode0.018s
                          🟢getSupported0.018s
                          🟢getSystemLimits0.019s
                          🟢getTextureFormats0.020s
                          🟢getTextureTypes0.017s
                          🟢getWidth0.018s
                          🟢intersectScissor0.018s

                          Expected

                          Actual

                          🟢inverseTransformPoint0.018s
                          🟢isActive0.018s
                          🟢isGammaCorrect0.019s
                          🟢isWireframe0.017s
                          🟢line0.016s

                          Expected

                          Actual

                          🟢newArrayImage0.018s
                          🟢newCanvas0.019s
                          🟢newCubeImage0.019s
                          🟢newFont0.019s
                          🟢newImage0.018s
                          🟢newImageFont0.017s
                          🟢newMesh0.018s
                          🟢newParticleSystem0.019s
                          🟢newQuad0.018s
                          🟢newShader0.018s
                          🟢newSpriteBatch0.018s
                          🟢newTextBatch0.017s
                          🟢newVideo0.017s
                          🟢newVolumeImage0.018s
                          🟢origin0.018s

                          Expected

                          Actual

                          🟢points0.018s

                          Expected

                          Actual

                          🟢polygon0.018s

                          Expected

                          Actual

                          🟢pop0.019s

                          Expected

                          Actual

                          🟡present0.018stest class needs writing
                          🟢print0.017s

                          Expected

                          Actual

                          🟢printf0.018s

                          Expected

                          Actual

                          🟢push0.018s

                          Expected

                          Actual

                          🟢rectangle0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢replaceTransform0.018s

                          Expected

                          Actual

                          🟢reset0.019s
                          🟢rotate0.019s

                          Expected

                          Actual

                          🟢scale0.017s
                          🟢setBackgroundColor0.017s
                          🟢setBlendMode0.017s

                          Expected

                          Actual

                          🟢setCanvas0.018s

                          Expected

                          Actual

                          🟢setColor0.018s

                          Expected

                          Actual

                          🔴setColorMask0.018sassert #7 [check pixel b for yellow at 0,0(set color mask)] expected '0' got '1'

                          Expected

                          Actual

                          🟢setDefaultFilter0.018s
                          🟢setDepthMode0.018s
                          🟢setFont0.018s

                          Expected

                          Actual

                          🟢setFrontFaceWinding0.019s
                          🟢setLineJoin0.017s

                          Expected

                          Actual

                          🟢setLineStyle0.018s

                          Expected

                          Actual

                          🟢setLineWidth0.018s

                          Expected

                          Actual

                          🟢setMeshCullMode0.018s
                          🟢setScissor0.018s

                          Expected

                          Actual

                          🟢setShader0.018s

                          Expected

                          Actual

                          🟢setStencilTest0.018s

                          Expected

                          Actual

                          🟢setWireframe0.016s

                          Expected

                          Actual

                          🟢shear0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢transformPoint0.018s
                          🟢translate0.019s

                          Expected

                          Actual

                          🟢validateShader0.019s

                          🟢 love.image

                          • 🟢 3 Tests
                          • 🔴 0 Failures
                          • 🟡 2 Skipped
                          • 0.087s


                            • MethodTimeDetails
                              🟡CompressedImageData0.015stest class needs writing
                              🟡ImageData0.018stest class needs writing
                              🟢isCompressed0.019s
                              🟢newCompressedData0.017s
                              🟢newImageData0.018s

                              🟢 love.math

                              • 🟢 17 Tests
                              • 🔴 0 Failures
                              • 🟡 3 Skipped
                              • 0.358s


                                • MethodTimeDetails
                                  🟡BezierCurve0.016stest class needs writing
                                  🟡RandomGenerator0.018stest class needs writing
                                  🟡Transform0.019stest class needs writing
                                  🟢colorFromBytes0.017s
                                  🟢colorToBytes0.018s
                                  🟢gammaToLinear0.017s
                                  🟢getRandomSeed0.018s
                                  🟢getRandomState0.017s
                                  🟢isConvex0.018s
                                  🟢linearToGamma0.017s
                                  🟢newBezierCurve0.018s
                                  🟢newRandomGenerator0.018s
                                  🟢newTransform0.020s
                                  🟢perlinNoise0.018s
                                  🟢random0.019s
                                  🟢randomNormal0.017s
                                  🟢setRandomSeed0.018s
                                  🟢setRandomState0.018s
                                  🟢simplexNoise0.018s
                                  🟢triangulate0.018s

                                  🟢 love.physics

                                  • 🟢 22 Tests
                                  • 🔴 0 Failures
                                  • 🟡 6 Skipped
                                  • 0.492s


                                    • MethodTimeDetails
                                      🟡Body0.015stest class needs writing
                                      🟡Contact0.017stest class needs writing
                                      🟡Fixture0.017stest class needs writing
                                      🟡Joint0.018stest class needs writing
                                      🟡Shape0.018stest class needs writing
                                      🟡World0.018stest class needs writing
                                      🟢getDistance0.017s
                                      🟢getMeter0.016s
                                      🟢newBody0.017s
                                      🟢newChainShape0.018s
                                      🟢newCircleShape0.019s
                                      🟢newDistanceJoint0.018s
                                      🟢newEdgeShape0.017s
                                      🟢newFixture0.019s
                                      🟢newFrictionJoint0.019s
                                      🟢newGearJoint0.019s
                                      🟢newMotorJoint0.018s
                                      🟢newMouseJoint0.017s
                                      🟢newPolygonShape0.017s
                                      🟢newPrismaticJoint0.017s
                                      🟢newPulleyJoint0.017s
                                      🟢newRectangleShape0.018s
                                      🟢newRevoluteJoint0.017s
                                      🟢newRopeJoint0.018s
                                      🟢newWeldJoint0.019s
                                      🟢newWheelJoint0.016s
                                      🟢newWorld0.018s
                                      🟢setMeter0.018s

                                      🟢 love.sound

                                      • 🟢 2 Tests
                                      • 🔴 0 Failures
                                      • 🟡 2 Skipped
                                      • 0.072s


                                        • MethodTimeDetails
                                          🟡Decoder0.016stest class needs writing
                                          🟡SoundData0.019stest class needs writing
                                          🟢newDecoder0.020s
                                          🟢newSoundData0.017s

                                          🟢 love.system

                                          • 🟢 6 Tests
                                          • 🔴 0 Failures
                                          • 🟡 2 Skipped
                                          • 0.142s


                                            • MethodTimeDetails
                                              🟢getClipboardText0.016s
                                              🟢getOS0.017s
                                              🟢getPowerInfo0.018s
                                              🟢getProcessorCount0.018s
                                              🟢hasBackgroundMusic0.019s
                                              🟡openURL0.018scant test this worked
                                              🟢setClipboardText0.018s
                                              🟡vibrate0.018scant test this worked

                                              🟢 love.thread

                                              • 🟢 3 Tests
                                              • 🔴 0 Failures
                                              • 🟡 2 Skipped
                                              • 0.088s


                                                • MethodTimeDetails
                                                  🟡Channel0.015stest class needs writing
                                                  🟡Thread0.018stest class needs writing
                                                  🟢getChannel0.018s
                                                  🟢newChannel0.019s
                                                  🟢newThread0.018s

                                                  🟢 love.timer

                                                  • 🟢 6 Tests
                                                  • 🔴 0 Failures
                                                  • 🟡 0 Skipped
                                                  • 2.086s


                                                    • MethodTimeDetails
                                                      🟢getAverageDelta0.015s
                                                      🟢getDelta0.017s
                                                      🟢getFPS0.018s
                                                      🟢getTime1.008s
                                                      🟢sleep1.011s
                                                      🟢step0.018s

                                                      🟢 love.video

                                                      • 🟢 1 Tests
                                                      • 🔴 0 Failures
                                                      • 🟡 1 Skipped
                                                      • 0.031s


                                                        • MethodTimeDetails
                                                          🟡VideoStream0.014stest class needs writing
                                                          🟢newVideoStream0.017s

                                                          🟢 love.window

                                                          • 🟢 34 Tests
                                                          • 🔴 0 Failures
                                                          • 🟡 2 Skipped
                                                          • 5.273s


                                                            • MethodTimeDetails
                                                              🟢close0.035s
                                                              🟢fromPixels0.002s
                                                              🟢getDPIScale0.002s
                                                              🟢getDesktopDimensions0.016s
                                                              🟢getDisplayCount0.018s
                                                              🟢getDisplayName0.018s
                                                              🟢getDisplayOrientation0.019s
                                                              🟢getFullscreen1.346s
                                                              🟢getFullscreenModes0.017s
                                                              🟢getIcon0.016s
                                                              🟢getMode0.017s
                                                              🟢getPosition0.017s
                                                              🟢getSafeArea0.017s
                                                              🟢getTitle0.017s
                                                              🟢getVSync0.018s
                                                              🟢hasFocus0.018s
                                                              🟢hasMouseFocus0.018s
                                                              🟢isDisplaySleepEnabled0.018s
                                                              🟢isMaximized0.186s
                                                              🟢isMinimized0.655s
                                                              🟢isOpen0.045s
                                                              🟢isVisible0.032s
                                                              🟢maximize0.172s
                                                              🟢minimize0.637s
                                                              🟡requestAttention0.003scant test this worked
                                                              🟢restore0.650s
                                                              🟢setDisplaySleepEnabled0.012s
                                                              🟢setFullscreen1.122s
                                                              🟢setIcon0.006s
                                                              🟢setMode0.018s
                                                              🟢setPosition0.017s
                                                              🟢setTitle0.018s
                                                              🟢setVSync0.017s
                                                              🟡showMessageBox0.017scant test this worked
                                                              🟢toPixels0.018s
                                                              🟢updateMode0.019s
\ No newline at end of file +

🔴 love.test

  • 🟢 275 Tests
  • 🔴 2 Failures
  • 🟡 28 Skipped
  • 16.781s


🔴 love.audio

  • 🟢 27 Tests
  • 🔴 1 Failures
  • 🟡 0 Skipped
  • 4.898s


    • MethodTimeDetails
      🟢RecordingDevice4.419s
      🔴Source0.019sassert 53 [check effect was applied] expected 'true' got 'false'
      🟢getActiveEffects0.013s
      🟢getActiveSourceCount0.018s
      🟢getDistanceModel0.018s
      🟢getDopplerScale0.019s
      🟢getEffect0.018s
      🟢getMaxSceneEffects0.017s
      🟢getMaxSourceEffects0.016s
      🟢getOrientation0.018s
      🟢getPosition0.017s
      🟢getRecordingDevices0.017s
      🟢getVelocity0.018s
      🟢getVolume0.018s
      🟢isEffectsSupported0.017s
      🟢newQueueableSource0.016s
      🟢newSource0.019s
      🟢pause0.019s
      🟢play0.019s
      🟢setDistanceModel0.019s
      🟢setDopplerScale0.018s
      🟢setEffect0.017s
      🟢setMixWithSystem0.017s
      🟢setOrientation0.019s
      🟢setPosition0.019s
      🟢setVelocity0.018s
      🟢setVolume0.017s
      🟢stop0.019s

      🟢 love.data

      • 🟢 12 Tests
      • 🔴 0 Failures
      • 🟡 0 Skipped
      • 0.213s


        • MethodTimeDetails
          🟢ByteData0.017s
          🟢CompressedData0.017s
          🟢compress0.018s
          🟢decode0.018s
          🟢decompress0.018s
          🟢encode0.018s
          🟢getPackedSize0.018s
          🟢hash0.019s
          🟢newByteData0.017s
          🟢newDataView0.017s
          🟢pack0.017s
          🟢unpack0.018s

          🟢 love.event

          • 🟢 4 Tests
          • 🔴 0 Failures
          • 🟡 2 Skipped
          • 0.103s


            • MethodTimeDetails
              🟢clear0.015s
              🟢poll0.017s
              🟡pump0.018sused internally
              🟢push0.018s
              🟢quit0.018s
              🟡wait0.017stest class needs writing

              🟢 love.filesystem

              • 🟢 29 Tests
              • 🔴 0 Failures
              • 🟡 2 Skipped
              • 0.561s


                • MethodTimeDetails
                  🟢File0.018s
                  🟢FileData0.019s
                  🟢append0.020s
                  🟢areSymlinksEnabled0.017s
                  🟢createDirectory0.019s
                  🟢getAppdataDirectory0.018s
                  🟢getCRequirePath0.017s
                  🟢getDirectoryItems0.018s
                  🟢getIdentity0.018s
                  🟢getInfo0.019s
                  🟢getRealDirectory0.018s
                  🟢getRequirePath0.017s
                  🟢getSaveDirectory0.017s
                  🟡getSource0.016sused internally
                  🟢getSourceBaseDirectory0.018s
                  🟢getUserDirectory0.017s
                  🟢getWorkingDirectory0.018s
                  🟢isFused0.018s
                  🟢lines0.022s
                  🟢load0.017s
                  🟢mount0.018s
                  🟢newFileData0.018s
                  🟢openFile0.018s
                  🟢read0.018s
                  🟢remove0.018s
                  🟢setCRequirePath0.018s
                  🟢setIdentity0.019s
                  🟢setRequirePath0.019s
                  🟡setSource0.017sused internally
                  🟢unmount0.018s
                  🟢write0.019s

                  🔴 love.font

                  • 🟢 6 Tests
                  • 🔴 1 Failures
                  • 🟡 0 Skipped
                  • 0.123s


                    • MethodTimeDetails
                      🔴GlyphData0.017sassert 8 [check glyph number] expected '97' got '0'
                      🟢Rasterizer0.018s
                      🟢newBMFontRasterizer0.018s
                      🟢newGlyphData0.018s
                      🟢newImageRasterizer0.018s
                      🟢newRasterizer0.017s
                      🟢newTrueTypeRasterizer0.019s

                      🟢 love.graphics

                      • 🟢 93 Tests
                      • 🔴 0 Failures
                      • 🟡 14 Skipped
                      • 2.106s


                        • MethodTimeDetails
                          🟡Canvas0.017stest class needs writing
                          🟡Font0.018stest class needs writing
                          🟡Image0.017stest class needs writing
                          🟡Mesh0.017stest class needs writing
                          🟡ParticleSystem0.017stest class needs writing
                          🟡Quad0.017stest class needs writing
                          🟡Shader0.018stest class needs writing
                          🟡SpriteBatch0.018stest class needs writing
                          🟡Text0.018stest class needs writing
                          🟡Texture0.018stest class needs writing
                          🟡Video0.007stest class needs writing
                          🟢applyTransform0.019s

                          Expected

                          Actual

                          🟢arc0.024s

                          Expected

                          Actual

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢captureScreenshot0.184s
                          🟢circle0.021s

                          Expected

                          Actual

                          🟢clear0.018s

                          Expected

                          Actual

                          🟡discard0.016scant test this worked
                          🟢draw0.018s

                          Expected

                          Actual

                          🟡drawInstanced0.018stest class needs writing
                          🟢drawLayer0.020s

                          Expected

                          Actual

                          🟢ellipse0.018s

                          Expected

                          Actual

                          🟢flushBatch0.017s
                          🟢getBackgroundColor0.018s
                          🟢getBlendMode0.018s
                          🟢getCanvas0.019s
                          🟢getColor0.017s
                          🟢getColorMask0.018s
                          🟢getDPIScale0.017s
                          🟢getDefaultFilter0.018s
                          🟢getDepthMode0.017s
                          🟢getDimensions0.018s
                          🟢getFont0.019s
                          🟢getFrontFaceWinding0.017s
                          🟢getHeight0.017s
                          🟢getLineJoin0.017s
                          🟢getLineStyle0.020s
                          🟢getLineWidth0.016s
                          🟢getMeshCullMode0.016s
                          🟢getPixelDimensions0.018s
                          🟢getPixelHeight0.018s
                          🟢getPixelWidth0.018s
                          🟢getPointSize0.016s
                          🟢getRendererInfo0.019s
                          🟢getScissor0.017s
                          🟢getShader0.019s
                          🟢getStackDepth0.018s
                          🟢getStats0.018s
                          🟢getStencilMode0.017s
                          🟢getSupported0.018s
                          🟢getSystemLimits0.018s
                          🟢getTextureFormats0.019s
                          🟢getTextureTypes0.018s
                          🟢getWidth0.017s
                          🟢intersectScissor0.019s

                          Expected

                          Actual

                          🟢inverseTransformPoint0.017s
                          🟢isActive0.017s
                          🟢isGammaCorrect0.018s
                          🟢isWireframe0.018s
                          🟢line0.019s

                          Expected

                          Actual

                          🟢newArrayImage0.019s
                          🟢newCanvas0.015s
                          🟢newCubeImage0.020s
                          🟢newFont0.018s
                          🟢newImage0.017s
                          🟢newImageFont0.019s
                          🟢newMesh0.018s
                          🟢newParticleSystem0.018s
                          🟢newQuad0.017s
                          🟢newShader0.022s
                          🟢newSpriteBatch0.019s
                          🟢newTextBatch0.016s
                          🟢newVideo0.021s
                          🟢newVolumeImage0.019s
                          🟢origin0.018s

                          Expected

                          Actual

                          🟢points0.019s

                          Expected

                          Actual

                          🟢polygon0.016s

                          Expected

                          Actual

                          🟢pop0.019s

                          Expected

                          Actual

                          🟡present0.018stest class needs writing
                          🟢print0.019s

                          Expected

                          Actual

                          🟢printf0.019s

                          Expected

                          Actual

                          🟢push0.021s

                          Expected

                          Actual

                          🟢rectangle0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢replaceTransform0.017s

                          Expected

                          Actual

                          🟢reset0.017s
                          🟢rotate0.020s

                          Expected

                          Actual

                          🟢scale0.020s
                          🟢setBackgroundColor0.017s
                          🟢setBlendMode0.020s

                          Expected

                          Actual

                          🟢setCanvas0.019s

                          Expected

                          Actual

                          🟢setColor0.018s

                          Expected

                          Actual

                          🟢setColorMask0.019s

                          Expected

                          Actual

                          🟢setDefaultFilter0.018s
                          🟢setDepthMode0.018s
                          🟢setFont0.018s

                          Expected

                          Actual

                          🟢setFrontFaceWinding0.018s
                          🟢setLineJoin0.020s

                          Expected

                          Actual

                          🟢setLineStyle0.017s

                          Expected

                          Actual

                          🟢setLineWidth0.018s

                          Expected

                          Actual

                          🟢setMeshCullMode0.018s
                          🟢setScissor0.018s

                          Expected

                          Actual

                          🟢setShader0.024s

                          Expected

                          Actual

                          🟢setStencilTest0.018s

                          Expected

                          Actual

                          🟢setWireframe0.019s

                          Expected

                          Actual

                          🟢shear0.021s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢transformPoint0.016s
                          🟢translate0.020s

                          Expected

                          Actual

                          🟢validateShader0.021s

                          🟢 love.image

                          • 🟢 5 Tests
                          • 🔴 0 Failures
                          • 🟡 0 Skipped
                          • 0.088s


                            • MethodTimeDetails
                              🟢CompressedImageData0.018s
                              🟢ImageData0.018s
                              🟢isCompressed0.017s
                              🟢newCompressedData0.018s
                              🟢newImageData0.018s

                              🟢 love.math

                              • 🟢 20 Tests
                              • 🔴 0 Failures
                              • 🟡 0 Skipped
                              • 0.284s


                                • MethodTimeDetails
                                  🟢BezierCurve0.016s
                                  🟢RandomGenerator0.017s
                                  🟢Transform0.017s
                                  🟢colorFromBytes0.018s
                                  🟢colorToBytes0.018s
                                  🟢gammaToLinear0.017s
                                  🟢getRandomSeed0.017s
                                  🟢getRandomState0.018s
                                  🟢isConvex0.018s
                                  🟢linearToGamma0.018s
                                  🟢newBezierCurve0.018s
                                  🟢newRandomGenerator0.018s
                                  🟢newTransform0.017s
                                  🟢perlinNoise0.019s
                                  🟢random0.012s
                                  🟢randomNormal0.017s
                                  🟢setRandomSeed0.002s
                                  🟢setRandomState0.002s
                                  🟢simplexNoise0.002s
                                  🟢triangulate0.003s

                                  🟢 love.physics

                                  • 🟢 22 Tests
                                  • 🔴 0 Failures
                                  • 🟡 6 Skipped
                                  • 0.059s


                                    • MethodTimeDetails
                                      🟡Body0.002stest class needs writing
                                      🟡Contact0.002stest class needs writing
                                      🟡Fixture0.002stest class needs writing
                                      🟡Joint0.002stest class needs writing
                                      🟡Shape0.002stest class needs writing
                                      🟡World0.002stest class needs writing
                                      🟢getDistance0.002s
                                      🟢getMeter0.002s
                                      🟢newBody0.002s
                                      🟢newChainShape0.002s
                                      🟢newCircleShape0.005s
                                      🟢newDistanceJoint0.002s
                                      🟢newEdgeShape0.002s
                                      🟢newFixture0.002s
                                      🟢newFrictionJoint0.002s
                                      🟢newGearJoint0.002s
                                      🟢newMotorJoint0.002s
                                      🟢newMouseJoint0.002s
                                      🟢newPolygonShape0.002s
                                      🟢newPrismaticJoint0.002s
                                      🟢newPulleyJoint0.002s
                                      🟢newRectangleShape0.002s
                                      🟢newRevoluteJoint0.002s
                                      🟢newRopeJoint0.002s
                                      🟢newWeldJoint0.002s
                                      🟢newWheelJoint0.002s
                                      🟢newWorld0.002s
                                      🟢setMeter0.002s

                                      🟢 love.sound

                                      • 🟢 4 Tests
                                      • 🔴 0 Failures
                                      • 🟡 0 Skipped
                                      • 0.015s


                                        • MethodTimeDetails
                                          🟢Decoder0.007s
                                          🟢SoundData0.003s
                                          🟢newDecoder0.002s
                                          🟢newSoundData0.003s

                                          🟢 love.system

                                          • 🟢 6 Tests
                                          • 🔴 0 Failures
                                          • 🟡 2 Skipped
                                          • 0.023s


                                            • MethodTimeDetails
                                              🟢getClipboardText0.004s
                                              🟢getOS0.007s
                                              🟢getPowerInfo0.002s
                                              🟢getProcessorCount0.002s
                                              🟢hasBackgroundMusic0.002s
                                              🟡openURL0.002scant test this worked
                                              🟢setClipboardText0.003s
                                              🟡vibrate0.002scant test this worked

                                              🟢 love.thread

                                              • 🟢 5 Tests
                                              • 🔴 0 Failures
                                              • 🟡 0 Skipped
                                              • 0.318s


                                                • MethodTimeDetails
                                                  🟢Channel0.220s
                                                  🟢Thread0.092s
                                                  🟢getChannel0.002s
                                                  🟢newChannel0.002s
                                                  🟢newThread0.002s

                                                  🟢 love.timer

                                                  • 🟢 6 Tests
                                                  • 🔴 0 Failures
                                                  • 🟡 0 Skipped
                                                  • 2.020s


                                                    • MethodTimeDetails
                                                      🟢getAverageDelta0.002s
                                                      🟢getDelta0.002s
                                                      🟢getFPS0.002s
                                                      🟢getTime1.003s
                                                      🟢sleep1.006s
                                                      🟢step0.004s

                                                      🟢 love.video

                                                      • 🟢 2 Tests
                                                      • 🔴 0 Failures
                                                      • 🟡 0 Skipped
                                                      • 0.016s


                                                        • MethodTimeDetails
                                                          🟢VideoStream0.009s
                                                          🟢newVideoStream0.007s

                                                          🟢 love.window

                                                          • 🟢 34 Tests
                                                          • 🔴 0 Failures
                                                          • 🟡 2 Skipped
                                                          • 5.954s


                                                            • MethodTimeDetails
                                                              🟢close0.054s
                                                              🟢fromPixels0.002s
                                                              🟢getDPIScale0.002s
                                                              🟢getDesktopDimensions0.002s
                                                              🟢getDisplayCount0.002s
                                                              🟢getDisplayName0.015s
                                                              🟢getDisplayOrientation0.017s
                                                              🟢getFullscreen1.340s
                                                              🟢getFullscreenModes0.009s
                                                              🟢getIcon0.019s
                                                              🟢getMode0.014s
                                                              🟢getPosition0.017s
                                                              🟢getSafeArea0.017s
                                                              🟢getTitle0.018s
                                                              🟢getVSync0.017s
                                                              🟢hasFocus0.018s
                                                              🟢hasMouseFocus0.018s
                                                              🟢isDisplaySleepEnabled0.017s
                                                              🟢isMaximized0.186s
                                                              🟢isMinimized0.744s
                                                              🟢isOpen0.054s
                                                              🟢isVisible0.031s
                                                              🟢maximize0.173s
                                                              🟢minimize0.740s
                                                              🟡requestAttention0.003scant test this worked
                                                              🟢restore0.840s
                                                              🟢setDisplaySleepEnabled0.016s
                                                              🟢setFullscreen1.335s
                                                              🟢setIcon0.013s
                                                              🟢setMode0.021s
                                                              🟢setPosition0.178s
                                                              🟢setTitle0.003s
                                                              🟢setVSync0.002s
                                                              🟡showMessageBox0.002scant test this worked
                                                              🟢toPixels0.002s
                                                              🟢updateMode0.014s
\ No newline at end of file diff --git a/testing/examples/lovetest_runAllTests.md b/testing/examples/lovetest_runAllTests.md index cfe0105b0..c69865ba7 100644 --- a/testing/examples/lovetest_runAllTests.md +++ b/testing/examples/lovetest_runAllTests.md @@ -1,28 +1,31 @@ - + -**305** tests were completed in **12.195s** with **254** passed, **1** failed, and **50** skipped +**305** tests were completed in **16.781s** with **275** passed, **2** failed, and **28** skipped ### Report -| Module | Passed | Failed | Skipped | Time | +| Module | Pass | Fail | Skip | Time | | --------------------- | ------ | ------ | ------- | ------ | -| 🟢 audio | 26 | 0 | 2 | 0.473s | -| 🟢 data | 7 | 0 | 5 | 0.212s | -| 🟢 event | 4 | 0 | 2 | 0.108s | -| 🟢 filesystem | 28 | 0 | 3 | 0.556s | -| 🟢 font | 4 | 0 | 3 | 0.127s | -| 🔴 graphics | 91 | 1 | 15 | 2.091s | -| 🟢 image | 3 | 0 | 2 | 0.087s | -| 🟢 math | 17 | 0 | 3 | 0.358s | -| 🟢 physics | 22 | 0 | 6 | 0.492s | -| 🟢 sound | 2 | 0 | 2 | 0.072s | -| 🟢 system | 6 | 0 | 2 | 0.142s | -| 🟢 thread | 3 | 0 | 2 | 0.088s | -| 🟢 timer | 6 | 0 | 0 | 2.086s | -| 🟢 video | 1 | 0 | 1 | 0.031s | -| 🟢 window | 34 | 0 | 2 | 5.273s | +| 🔴 audio | 27 | 1 | 0 | 4.898s | +| 🟢 data | 12 | 0 | 0 | 0.213s | +| 🟢 event | 4 | 0 | 2 | 0.103s | +| 🟢 filesystem | 29 | 0 | 2 | 0.561s | +| 🔴 font | 6 | 1 | 0 | 0.123s | +| 🟢 graphics | 93 | 0 | 14 | 2.106s | +| 🟢 image | 5 | 0 | 0 | 0.088s | +| 🟢 math | 20 | 0 | 0 | 0.284s | +| 🟢 physics | 22 | 0 | 6 | 0.059s | +| 🟢 sound | 4 | 0 | 0 | 0.015s | +| 🟢 system | 6 | 0 | 2 | 0.023s | +| 🟢 thread | 5 | 0 | 0 | 0.318s | +| 🟢 timer | 6 | 0 | 0 | 2.020s | +| 🟢 video | 2 | 0 | 0 | 0.016s | +| 🟢 window | 34 | 0 | 2 | 5.954s | ### Failures -> 🔴 setColorMask -> assert #7 [check pixel b for yellow at 0,0(set color mask)] expected '0' got '1' +> 🔴 Source +> assert 53 [check effect was applied] expected 'true' got 'false' + +> 🔴 GlyphData +> assert 8 [check glyph number] expected '97' got '0' diff --git a/testing/examples/lovetest_runAllTests.xml b/testing/examples/lovetest_runAllTests.xml index 73ada5cba..deb2d4201 100644 --- a/testing/examples/lovetest_runAllTests.xml +++ b/testing/examples/lovetest_runAllTests.xml @@ -1,122 +1,115 @@ - - - - + + + - - + + assert 53 [check effect was applied] expected 'true' got 'false' - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + - - + - + - + - - + - + - - + - - + - - + + - - + + - + - + - - + + - - + - + - + @@ -124,91 +117,89 @@ - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - - - + + + assert 8 [check glyph number] expected '97' got '0' - - + - - + - + - + - + - + - - + + - + - + - + - + @@ -223,65 +214,64 @@ - + - + - + - + - + - + - + - + - + - - + - + - + - + - + - + - + - + - + - + - + @@ -289,107 +279,106 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - assert #7 [check pixel b for yellow at 0,0(set color mask)] expected '0' got '1' + @@ -397,11 +386,11 @@ - + - + - + @@ -409,285 +398,275 @@ - + - + - + - + - + - + - - - + + - - + - + - + - - - + + - - + - - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + - - + - + - + - - + + - + - + - + - + - + - + - + - - - + + - - + - + - + - + - - + + - + - + - + - + - + - - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/testing/readme.md b/testing/readme.md index f9fdfd2cc..2f6f8bb42 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -101,6 +101,8 @@ love.test.filesystem.read = function(test) end ``` +Each test is run inside it's own coroutine - you can use `test:waitFrames(frames)` to pause the test for a small period if you need to check things that won't happen for a few seconds. + After each test method is ran, the assertions are totalled up, printed, and we move onto the next method! Once all methods in the suite are run a total pass/fail/skip is given for that module and we move onto the next module (if any) For sanity-checking, if it's currently not covered or it's not possible to test the method we can set the test to be skipped with `test:skipTest(reason)` - this way we still see the method listed in the test output without it affected the pass/fail totals @@ -108,13 +110,23 @@ For sanity-checking, if it's currently not covered or it's not possible to test --- ## Todo -Modules with some small bits needed or needing sense checking: -- **love.event** - love.event.wait or love.event.pump need writing if possible I dunno how to check -- **love.font** - newBMFontRasterizer() wiki entry is wrong so not sure whats expected -- **love.graphics** - still need to do tests for the main drawing methods -- **love.image** - ideally isCompressed should have an example of all compressed files love can take -- **love.*.objects** - all objects tests still to be done -- **love.graphics.setStencilTest** - deprecated, replaced by setStencilMode() +Things still left to do: +- [ ] physics.Body, physics.Contact, physics.Fixture, + physics.Joint, physics.Shape, physics.World +- [ ] graphics.Canvas, graphics.Font, graphics.Image, graphics.Mesh, + graphics.ParticleSystem, graphics.Quad, graphics.Shader, + graphics.SpriteBatch, graphics.Text, graphics.Texture, graphics.Video +- [ ] event.wait +- [ ] graphics.present +- [ ] graphics.drawInstanced +- [ ] graphics.setDepthMode (needs actual graphical comparison if possible) +- [ ] graphics.setFrontFaceWinding (needs actual graphical comparison if possible) +- [ ] graphics.setMeshCullMode (needs actual graphical comparison if possible) +- [ ] @deprecated setStencilTest (use setStencilMode) +- [ ] @deprecated physics methods (sasha changes) +- [ ] check 12.0 wiki page for new methods +- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) +- [ ] ideally graphics.isCompressed should have an example of all compressed files love can take --- diff --git a/testing/resources/alsoft.conf b/testing/resources/alsoft.conf index 3e28208eb..6d1add00f 100644 --- a/testing/resources/alsoft.conf +++ b/testing/resources/alsoft.conf @@ -1,4 +1,491 @@ +# OpenAL config file. +# +# Option blocks may appear multiple times, and duplicated options will take the +# last value specified. Environment variables may be specified within option +# values, and are automatically substituted when the config file is loaded. +# Environment variable names may only contain alpha-numeric characters (a-z, +# A-Z, 0-9) and underscores (_), and are prefixed with $. For example, +# specifying "$HOME/file.ext" would typically result in something like +# "/home/user/file.ext". To specify an actual "$" character, use "$$". +# +# Device-specific values may be specified by including the device name in the +# block name, with "general" replaced by the device name. That is, general +# options for the device "Name of Device" would be in the [Name of Device] +# block, while ALSA options would be in the [alsa/Name of Device] block. +# Options marked as "(global)" are not influenced by the device. +# +# The system-wide settings can be put in /etc/openal/alsoft.conf and user- +# specific override settings in $HOME/.alsoftrc. +# For Windows, these settings should go into $AppData\alsoft.ini +# +# Option and block names are case-senstive. The supplied values are only hints +# and may not be honored (though generally it'll try to get as close as +# possible). Note: options that are left unset may default to app- or system- +# specified values. These are the current available settings: + +## +## General stuff +## [general] + +## disable-cpu-exts: (global) +# Disables use of specialized methods that use specific CPU intrinsics. +# Certain methods may utilize CPU extensions for improved performance, and +# this option is useful for preventing some or all of those methods from being +# used. The available extensions are: sse, sse2, sse3, sse4.1, and neon. +# Specifying 'all' disables use of all such specialized methods. +#disable-cpu-exts = + +## drivers: (global) +# Sets the backend driver list order, comma-seperated. Unknown backends and +# duplicated names are ignored. Unlisted backends won't be considered for use +# unless the list is ended with a comma (e.g. 'oss,' will try OSS first before +# other backends, while 'oss' will try OSS only). Backends prepended with - +# won't be considered for use (e.g. '-oss,' will try all available backends +# except OSS). An empty list means to try all backends. drivers = wave + +## channels: +# Sets the output channel configuration. If left unspecified, one will try to +# be detected from the system, and defaulting to stereo. The available values +# are: mono, stereo, quad, surround51, surround51rear, surround61, surround71, +# ambi1, ambi2, ambi3. Note that the ambi* configurations provide ambisonic +# channels of the given order (using ACN ordering and SN3D normalization by +# default), which need to be decoded to play correctly on speakers. +#channels = + +## sample-type: +# Sets the output sample type. Currently, all mixing is done with 32-bit float +# and converted to the output sample type as needed. Available values are: +# int8 - signed 8-bit int +# uint8 - unsigned 8-bit int +# int16 - signed 16-bit int +# uint16 - unsigned 16-bit int +# int32 - signed 32-bit int +# uint32 - unsigned 32-bit int +# float32 - 32-bit float +#sample-type = float32 + +## frequency: +# Sets the output frequency. If left unspecified it will try to detect a +# default from the system, otherwise it will default to 44100. +#frequency = + +## period_size: +# Sets the update period size, in frames. This is the number of frames needed +# for each mixing update. Acceptable values range between 64 and 8192. +#period_size = 1024 + +## periods: +# Sets the number of update periods. Higher values create a larger mix ahead, +# which helps protect against skips when the CPU is under load, but increases +# the delay between a sound getting mixed and being heard. Acceptable values +# range between 2 and 16. +#periods = 3 + +## stereo-mode: +# Specifies if stereo output is treated as being headphones or speakers. With +# headphones, HRTF or crossfeed filters may be used for better audio quality. +# Valid settings are auto, speakers, and headphones. +#stereo-mode = auto + +## stereo-encoding: +# Specifies the encoding method for non-HRTF stereo output. 'panpot' (default) +# uses standard amplitude panning (aka pair-wise, stereo pair, etc) between +# -30 and +30 degrees, while 'uhj' creates stereo-compatible two-channel UHJ +# output, which encodes some surround sound information into stereo output +# that can be decoded with a surround sound receiver. If crossfeed filters are +# used, UHJ is disabled. +#stereo-encoding = panpot + +## ambi-format: +# Specifies the channel order and normalization for the "ambi*" set of channel +# configurations. Valid settings are: fuma, acn+sn3d, acn+n3d +#ambi-format = acn+sn3d + +## hrtf: +# Controls HRTF processing. These filters provide better spatialization of +# sounds while using headphones, but do require a bit more CPU power. The +# default filters will only work with 44100hz or 48000hz stereo output. While +# HRTF is used, the cf_level option is ignored. Setting this to auto (default) +# will allow HRTF to be used when headphones are detected or the app requests +# it, while setting true or false will forcefully enable or disable HRTF +# respectively. +#hrtf = auto + +## default-hrtf: +# Specifies the default HRTF to use. When multiple HRTFs are available, this +# determines the preferred one to use if none are specifically requested. Note +# that this is the enumerated HRTF name, not necessarily the filename. +#default-hrtf = + +## hrtf-paths: +# Specifies a comma-separated list of paths containing HRTF data sets. The +# format of the files are described in docs/hrtf.txt. The files within the +# directories must have the .mhr file extension to be recognized. By default, +# OS-dependent data paths will be used. They will also be used if the list +# ends with a comma. On Windows this is: +# $AppData\openal\hrtf +# And on other systems, it's (in order): +# $XDG_DATA_HOME/openal/hrtf (defaults to $HOME/.local/share/openal/hrtf) +# $XDG_DATA_DIRS/openal/hrtf (defaults to /usr/local/share/openal/hrtf and +# /usr/share/openal/hrtf) +#hrtf-paths = + +## cf_level: +# Sets the crossfeed level for stereo output. Valid values are: +# 0 - No crossfeed +# 1 - Low crossfeed +# 2 - Middle crossfeed +# 3 - High crossfeed (virtual speakers are closer to itself) +# 4 - Low easy crossfeed +# 5 - Middle easy crossfeed +# 6 - High easy crossfeed +# Users of headphones may want to try various settings. Has no effect on non- +# stereo modes. +#cf_level = 0 + +## resampler: (global) +# Selects the resampler used when mixing sources. Valid values are: +# point - nearest sample, no interpolation +# linear - extrapolates samples using a linear slope between samples +# cubic - extrapolates samples using a Catmull-Rom spline +# bsinc12 - extrapolates samples using a band-limited Sinc filter (varying +# between 12 and 24 points, with anti-aliasing) +# bsinc24 - extrapolates samples using a band-limited Sinc filter (varying +# between 24 and 48 points, with anti-aliasing) +#resampler = linear + +## rt-prio: (global) +# Sets real-time priority for the mixing thread. Not all drivers may use this +# (eg. PortAudio) as they already control the priority of the mixing thread. +# 0 and negative values will disable it. Note that this may constitute a +# security risk since a real-time priority thread can indefinitely block +# normal-priority threads if it fails to wait. As such, the default is +# disabled. +#rt-prio = 0 + +## sources: +# Sets the maximum number of allocatable sources. Lower values may help for +# systems with apps that try to play more sounds than the CPU can handle. +#sources = 256 + +## slots: +# Sets the maximum number of Auxiliary Effect Slots an app can create. A slot +# can use a non-negligible amount of CPU time if an effect is set on it even +# if no sources are feeding it, so this may help when apps use more than the +# system can handle. +#slots = 64 + +## sends: +# Limits the number of auxiliary sends allowed per source. Setting this higher +# than the default has no effect. +#sends = 16 + +## front-stablizer: +# Applies filters to "stablize" front sound imaging. A psychoacoustic method +# is used to generate a front-center channel signal from the front-left and +# front-right channels, improving the front response by reducing the combing +# artifacts and phase errors. Consequently, it will only work with channel +# configurations that include front-left, front-right, and front-center. +#front-stablizer = false + +## output-limiter: +# Applies a gain limiter on the final mixed output. This reduces the volume +# when the output samples would otherwise clamp, avoiding excessive clipping +# noise. +#output-limiter = true + +## dither: +# Applies dithering on the final mix, for 8- and 16-bit output by default. +# This replaces the distortion created by nearest-value quantization with low- +# level whitenoise. +#dither = true + +## dither-depth: +# Quantization bit-depth for dithered output. A value of 0 (or less) will +# match the output sample depth. For int32, uint32, and float32 output, 0 will +# disable dithering because they're at or beyond the rendered precision. The +# maximum dither depth is 24. +#dither-depth = 0 + +## volume-adjust: +# A global volume adjustment for source output, expressed in decibels. The +# value is logarithmic, so +6 will be a scale of (approximately) 2x, +12 will +# be a scale of 4x, etc. Similarly, -6 will be x1/2, and -12 is about x1/4. A +# value of 0 means no change. +#volume-adjust = 0 + +## excludefx: (global) +# Sets which effects to exclude, preventing apps from using them. This can +# help for apps that try to use effects which are too CPU intensive for the +# system to handle. Available effects are: eaxreverb,reverb,autowah,chorus, +# compressor,distortion,echo,equalizer,flanger,modulator,dedicated,pshifter, +# fshifter +#excludefx = + +## default-reverb: (global) +# A reverb preset that applies by default to all sources on send 0 +# (applications that set their own slots on send 0 will override this). +# Available presets are: None, Generic, PaddedCell, Room, Bathroom, +# Livingroom, Stoneroom, Auditorium, ConcertHall, Cave, Arena, Hangar, +# CarpetedHallway, Hallway, StoneCorridor, Alley, Forest, City, Moutains, +# Quarry, Plain, ParkingLot, SewerPipe, Underwater, Drugged, Dizzy, Psychotic. +#default-reverb = + +## trap-alc-error: (global) +# Generates a SIGTRAP signal when an ALC device error is generated, on systems +# that support it. This helps when debugging, while trying to find the cause +# of a device error. On Windows, a breakpoint exception is generated. +#trap-alc-error = false + +## trap-al-error: (global) +# Generates a SIGTRAP signal when an AL context error is generated, on systems +# that support it. This helps when debugging, while trying to find the cause +# of a context error. On Windows, a breakpoint exception is generated. +#trap-al-error = false + +## +## Ambisonic decoder stuff +## +[decoder] + +## hq-mode: +# Enables a high-quality ambisonic decoder. This mode is capable of frequency- +# dependent processing, creating a better reproduction of 3D sound rendering +# over surround sound speakers. Enabling this also requires specifying decoder +# configuration files for the appropriate speaker configuration you intend to +# use (see the quad, surround51, etc options below). Currently, up to third- +# order decoding is supported. +hq-mode = false + +## distance-comp: +# Enables compensation for the speakers' relative distances to the listener. +# This applies the necessary delays and attenuation to make the speakers +# behave as though they are all equidistant, which is important for proper +# playback of 3D sound rendering. Requires the proper distances to be +# specified in the decoder configuration file. +distance-comp = true + +## nfc: +# Enables near-field control filters. This simulates and compensates for low- +# frequency effects caused by the curvature of nearby sound-waves, which +# creates a more realistic perception of sound distance. Note that the effect +# may be stronger or weaker than intended if the application doesn't use or +# specify an appropriate unit scale, or if incorrect speaker distances are set +# in the decoder configuration file. Requires hq-mode to be enabled. +nfc = true + +## nfc-ref-delay +# Specifies the reference delay value for ambisonic output. When channels is +# set to one of the ambi* formats, this option enables NFC-HOA output with the +# specified Reference Delay parameter. The specified value can then be shared +# with an appropriate NFC-HOA decoder to reproduce correct near-field effects. +# Keep in mind that despite being designed for higher-order ambisonics, this +# applies to first-order output all the same. When left unset, normal output +# is created with no near-field simulation. +nfc-ref-delay = + +## quad: +# Decoder configuration file for Quadraphonic channel output. See +# docs/ambdec.txt for a description of the file format. +quad = + +## surround51: +# Decoder configuration file for 5.1 Surround (Side and Rear) channel output. +# See docs/ambdec.txt for a description of the file format. +surround51 = + +## surround61: +# Decoder configuration file for 6.1 Surround channel output. See +# docs/ambdec.txt for a description of the file format. +surround61 = + +## surround71: +# Decoder configuration file for 7.1 Surround channel output. See +# docs/ambdec.txt for a description of the file format. Note: This can be used +# to enable 3D7.1 with the appropriate configuration and speaker placement, +# see docs/3D7.1.txt. +surround71 = + +## +## Reverb effect stuff (includes EAX reverb) +## +[reverb] + +## boost: (global) +# A global amplification for reverb output, expressed in decibels. The value +# is logarithmic, so +6 will be a scale of (approximately) 2x, +12 will be a +# scale of 4x, etc. Similarly, -6 will be about half, and -12 about 1/4th. A +# value of 0 means no change. +#boost = 0 + +## +## PulseAudio backend stuff +## +[pulse] + +## spawn-server: (global) +# Attempts to autospawn a PulseAudio server whenever needed (initializing the +# backend, enumerating devices, etc). Setting autospawn to false in Pulse's +# client.conf will still prevent autospawning even if this is set to true. +#spawn-server = true + +## allow-moves: (global) +# Allows PulseAudio to move active streams to different devices. Note that the +# device specifier (seen by applications) will not be updated when this +# occurs, and neither will the AL device configuration (sample rate, format, +# etc). +#allow-moves = false + +## fix-rate: +# Specifies whether to match the playback stream's sample rate to the device's +# sample rate. Enabling this forces OpenAL Soft to mix sources and effects +# directly to the actual output rate, avoiding a second resample pass by the +# PulseAudio server. +#fix-rate = false + +## +## ALSA backend stuff +## +[alsa] + +## device: (global) +# Sets the device name for the default playback device. +#device = default + +## device-prefix: (global) +# Sets the prefix used by the discovered (non-default) playback devices. This +# will be appended with "CARD=c,DEV=d", where c is the card id and d is the +# device index for the requested device name. +#device-prefix = plughw: + +## device-prefix-*: (global) +# Card- and device-specific prefixes may be used to override the device-prefix +# option. The option may specify the card id (eg, device-prefix-NVidia), or +# the card id and device index (eg, device-prefix-NVidia-0). The card id is +# case-sensitive. +#device-prefix- = + +## capture: (global) +# Sets the device name for the default capture device. +#capture = default + +## capture-prefix: (global) +# Sets the prefix used by the discovered (non-default) capture devices. This +# will be appended with "CARD=c,DEV=d", where c is the card id and d is the +# device number for the requested device name. +#capture-prefix = plughw: + +## capture-prefix-*: (global) +# Card- and device-specific prefixes may be used to override the +# capture-prefix option. The option may specify the card id (eg, +# capture-prefix-NVidia), or the card id and device index (eg, +# capture-prefix-NVidia-0). The card id is case-sensitive. +#capture-prefix- = + +## mmap: +# Sets whether to try using mmap mode (helps reduce latencies and CPU +# consumption). If mmap isn't available, it will automatically fall back to +# non-mmap mode. True, yes, on, and non-0 values will attempt to use mmap. 0 +# and anything else will force mmap off. +#mmap = true + +## allow-resampler: +# Specifies whether to allow ALSA's built-in resampler. Enabling this will +# allow the playback device to be set to a different sample rate than the +# actual output, causing ALSA to apply its own resampling pass after OpenAL +# Soft resamples and mixes the sources and effects for output. +#allow-resampler = false + +## +## OSS backend stuff +## +[oss] + +## device: (global) +# Sets the device name for OSS output. +#device = /dev/dsp + +## capture: (global) +# Sets the device name for OSS capture. +#capture = /dev/dsp + +## +## Solaris backend stuff +## +[solaris] + +## device: (global) +# Sets the device name for Solaris output. +#device = /dev/audio + +## +## QSA backend stuff +## +[qsa] + +## +## JACK backend stuff +## +[jack] + +## spawn-server: (global) +# Attempts to autospawn a JACK server whenever needed (initializing the +# backend, opening devices, etc). +#spawn-server = false + +## buffer-size: +# Sets the update buffer size, in samples, that the backend will keep buffered +# to handle the server's real-time processing requests. This value must be a +# power of 2, or else it will be rounded up to the next power of 2. If it is +# less than JACK's buffer update size, it will be clamped. This option may +# be useful in case the server's update size is too small and doesn't give the +# mixer time to keep enough audio available for the processing requests. +#buffer-size = 0 + +## +## WASAPI backend stuff +## +[wasapi] + +## +## DirectSound backend stuff +## +[dsound] + +## +## Windows Multimedia backend stuff +## +[winmm] + +## +## PortAudio backend stuff +## +[port] + +## device: (global) +# Sets the device index for output. Negative values will use the default as +# given by PortAudio itself. +#device = -1 + +## capture: (global) +# Sets the device index for capture. Negative values will use the default as +# given by PortAudio itself. +#capture = -1 + +## +## Wave File Writer stuff +## [wave] -file = output.wav \ No newline at end of file + +## file: (global) +# Sets the filename of the wave file to write to. An empty name prevents the +# backend from opening, even when explicitly requested. +# THIS WILL OVERWRITE EXISTING FILES WITHOUT QUESTION! +file = output.wav + +## bformat: (global) +# Creates AMB format files using first-order ambisonics instead of a standard +# single- or multi-channel .wav file. +#bformat = false \ No newline at end of file diff --git a/testing/tests/audio.lua b/testing/tests/audio.lua index 86912966e..f1450d577 100644 --- a/testing/tests/audio.lua +++ b/testing/tests/audio.lua @@ -15,36 +15,32 @@ love.test.audio.RecordingDevice = function(test) if #devices == 0 then return test:skipTest('cant test this works: no recording devices found') end - -- test device - if test:isDelayed() == false then - -- check object created and basics - local device = devices[1] - test.store.device = device - test:assertObject(device) - test:assertMatch({1, 2}, device:getChannelCount(), 'check channel count is 1 or 2') - test:assertNotEquals(nil, device:getName(), 'check has name') - -- check initial data is empty as we haven't recorded anything yet - test:assertNotNil(device:getBitDepth()) - test:assertEquals(nil, device:getData(), 'check initial data empty') - test:assertEquals(0, device:getSampleCount(), 'check initial sample empty') - test:assertNotNil(device:getSampleRate()) - test:assertEquals(false, device:isRecording(), 'check not recording') - -- start recording for a short time - local startrecording = device:start(32000, 4000, 16, 1) - test:assertEquals(true, startrecording, 'check recording started') - test:assertEquals(true, device:isRecording(), 'check now recording') - test:assertEquals(4000, device:getSampleRate(), 'check sample rate set') - test:assertEquals(16, device:getBitDepth(), 'check bit depth set') - test:assertEquals(1, device:getChannelCount(), 'check channel count set') - test:setDelay(20) + -- check object created and basics + local device = devices[1] + test:assertObject(device) + test:assertMatch({1, 2}, device:getChannelCount(), 'check channel count is 1 or 2') + test:assertNotEquals(nil, device:getName(), 'check has name') + -- check initial data is empty as we haven't recorded anything yet + test:assertNotNil(device:getBitDepth()) + test:assertEquals(nil, device:getData(), 'check initial data empty') + test:assertEquals(0, device:getSampleCount(), 'check initial sample empty') + test:assertNotNil(device:getSampleRate()) + test:assertEquals(false, device:isRecording(), 'check not recording') + -- start recording for a short time + -- @TODO needs delay for VMs + local startrecording = device:start(32000, 4000, 16, 1) + test:waitFrames(120) + test:assertEquals(true, startrecording, 'check recording started') + test:assertEquals(true, device:isRecording(), 'check now recording') + test:assertEquals(4000, device:getSampleRate(), 'check sample rate set') + test:assertEquals(16, device:getBitDepth(), 'check bit depth set') + test:assertEquals(1, device:getChannelCount(), 'check channel count set') + local recording = device:stop() + test:waitFrames(120) -- after recording - else - local device = test.store.device - local recording = device:stop() - test:assertEquals(false, device:isRecording(), 'check not recording') - test:assertEquals(nil, device:getData(), 'using stop should clear buffer') - test:assertObject(recording) - end + test:assertEquals(false, device:isRecording(), 'check not recording') + test:assertEquals(nil, device:getData(), 'using stop should clear buffer') + test:assertObject(recording) end diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index 8a1d0f28b..53f229bc5 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -10,7 +10,49 @@ -- Canvas (love.graphics.newCanvas) love.test.graphics.Canvas = function(test) - test:skipTest('test class needs writing') + -- create canvas + local canvas = love.graphics.newCanvas(32, 32, { + + }) + test:assertObject(canvas) + -- check basic properties + test:assertNotNil(canvas:getMSAA()) + test:assertEquals('none', canvas:getMipmapMode(), 'check default mipmap') + --[[ + + Texture:getDPIScale check not nil + Texture:getDepth check >= 0 + Texture:getDimensions w, h + + Texture:getFormat (list of vals) + Texture:getHeight h + Texture:getLayerCount >= 0 + Texture:getMipmapCount >= 1 + Texture:getPixelDimensions w, h + dpi + Texture:getPixelHeight h + dpi + Texture:getPixelWidth w + dpi + Texture:getTextureType teture types (4 types) + Texture:getWidth w + Texture:isReadable true unless stencil/depth pixel formats + + Texture:getWrap + Texture:setWrap horiz, vert, depth + + Texture:getDepthSampleMode + Texture:setDepthSampleMode compare (list of vals) + + Texture:getFilter + Texture:setFilter min, mag, anisotrop + + Texture:getMipmapFilter + Texture:setMipmapFilter mode, sharpness + ]] + -- check rendering + canvas:renderTo(function() + + end) + local data = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) + -- check some pixels end @@ -489,14 +531,11 @@ end -- love.graphics.captureScreenshot love.test.graphics.captureScreenshot = function(test) - if test:isDelayed() == false then - love.graphics.captureScreenshot('example-screenshot.png') - test:setDelay(10) + love.graphics.captureScreenshot('example-screenshot.png') + test:waitFrames(10) -- need to wait until end of the frame for the screenshot - else - test:assertNotNil(love.filesystem.openFile('example-screenshot.png', 'r')) - love.filesystem.remove('example-screenshot.png') - end + test:assertNotNil(love.filesystem.openFile('example-screenshot.png', 'r')) + love.filesystem.remove('example-screenshot.png') end diff --git a/testing/tests/window.lua b/testing/tests/window.lua index 44d21a235..17e2ebca0 100644 --- a/testing/tests/window.lua +++ b/testing/tests/window.lua @@ -168,31 +168,25 @@ end -- love.window.isMaximized love.test.window.isMaximized = function(test) - if test:isDelayed() == false then - test:assertEquals(false, love.window.isMaximized(), 'check window not maximized') - love.window.maximize() - test:setDelay(10) - else - -- on MACOS maximize wont get recognised immedietely so wait a few frames - test:assertEquals(true, love.window.isMaximized(), 'check window now maximized') - love.window.restore() - end + test:assertEquals(false, love.window.isMaximized(), 'check window not maximized') + love.window.maximize() + test:waitFrames(10) + -- on MACOS maximize wont get recognised immedietely so wait a few frames + test:assertEquals(true, love.window.isMaximized(), 'check window now maximized') + love.window.restore() end -- love.window.isMinimized love.test.window.isMinimized = function(test) - if test:isDelayed() == false then - -- check not minimized to start - test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') - -- try to minimize - love.window.minimize() - test:setDelay(10) - else - -- on linux minimize won't get recognized immediately, so wait a few frames - test:assertEquals(true, love.window.isMinimized(), 'check window minimized') - love.window.restore() - end + -- check not minimized to start + test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') + -- try to minimize + love.window.minimize() + test:waitFrames(10) + -- on linux minimize won't get recognized immediately, so wait a few frames + test:assertEquals(true, love.window.isMinimized(), 'check window minimized') + love.window.restore() end @@ -220,31 +214,25 @@ end -- love.window.maximize love.test.window.maximize = function(test) - if test:isDelayed() == false then - test:assertEquals(false, love.window.isMaximized(), 'check window not maximized') - -- check maximizing is set - love.window.maximize() - test:setDelay(10) - else - -- on macos we need to wait a few frames - test:assertEquals(true, love.window.isMaximized(), 'check window maximized') - love.window.restore() - end + test:assertEquals(false, love.window.isMaximized(), 'check window not maximized') + -- check maximizing is set + love.window.maximize() + test:waitFrames(10) + -- on macos we need to wait a few frames + test:assertEquals(true, love.window.isMaximized(), 'check window maximized') + love.window.restore() end -- love.window.minimize love.test.window.minimize = function(test) - if test:isDelayed() == false then - test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') - -- check minimizing is set - love.window.minimize() - test:setDelay(10) - else - -- on linux we need to wait a few frames - test:assertEquals(true, love.window.isMinimized(), 'check window maximized') - love.window.restore() - end + test:assertEquals(false, love.window.isMinimized(), 'check window not minimized') + -- check minimizing is set + love.window.minimize() + test:waitFrames(10) + -- on linux we need to wait a few frames + test:assertEquals(true, love.window.isMinimized(), 'check window maximized') + love.window.restore() end @@ -256,20 +244,13 @@ end -- love.window.restore love.test.window.restore = function(test) - - -- TODO: for linux runner - -- test doesn't pass because the current test delay system can't wait twice - - if test:isDelayed() == false then - -- check minimized to start - love.window.minimize() - love.window.restore() - test:setDelay(10) - else - -- check restoring the state of the window - test:assertEquals(false, love.window.isMinimized(), 'check window restored') - end - + -- check minimized to start + love.window.minimize() + test:waitFrames(10) + love.window.restore() + test:waitFrames(10) + -- check restoring the state of the window + test:assertEquals(false, love.window.isMinimized(), 'check window restored') end @@ -327,15 +308,12 @@ end -- love.window.setPosition love.test.window.setPosition = function(test) - if test:isDelayed() == false then - -- check position is returned - love.window.setPosition(100, 100, 1) - test:setDelay(10) - else - local x, y, _ = love.window.getPosition() - test:assertEquals(100, x, 'check position x') - test:assertEquals(100, y, 'check position y') - end + -- check position is returned + love.window.setPosition(100, 100, 1) + test:waitFrames(10) + local x, y, _ = love.window.getPosition() + test:assertEquals(100, x, 'check position x') + test:assertEquals(100, y, 'check position y') end diff --git a/testing/todo.md b/testing/todo.md deleted file mode 100644 index b84d8d527..000000000 --- a/testing/todo.md +++ /dev/null @@ -1,26 +0,0 @@ -`/Applications/love_12.app/Contents/MacOS/love ./testing` - -## GENERAL -- [ ] check 12.0 wiki page for new methods -- [ ] change delay system to use coroutines -- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) - -## OBJECT TESTS -- [ ] physics.Body, physics.Contact, physics.Fixture, - physics.Joint, physics.Shape, physics.World -- [ ] threads.Channel, threads.Thread - -## METHOD TESTS -- [ ] event.wait -- [ ] graphics.present -- [ ] graphics.drawInstanced - -## DEPRECATED -- [ ] deprecated setStencilTest (use setStencilMode) -- [ ] deprecated physics methods - -## GRAPHIC TESTS -Methods that need a actual graphic pixel checks if possible: -- [ ] setDepthMode -- [ ] setFrontFaceWinding -- [ ] setMeshCullMode From 137126656a30492333e3a5eef03e4c9f73f15d6a Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:00:09 +0000 Subject: [PATCH 21/54] update ci run --- .github/workflows/main.yml | 9 +++++--- testing/tests/audio.lua | 4 ++-- testing/tests/graphics.lua | 44 +------------------------------------- 3 files changed, 9 insertions(+), 48 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57c697ac4..20e108c56 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: echo "OPENBOXPID=$!" >> $GITHUB_ENV # linux opengl tests - name: Run All Tests (opengl) - run: xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua + run: ./love-${{ github.sha }}.AppImage ./testing/main.lua - name: Love Test Report (opengl) uses: ellraiser/love-test-report@main with: @@ -89,7 +89,7 @@ jobs: - name: Run Test Suite (opengles) run: | export LOVE_GRAPHICS_USE_OPENGLES=1 - xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua + ./love-${{ github.sha }}.AppImage ./testing/main.lua - name: Love Test Report (opengles) uses: ellraiser/love-test-report@main with: @@ -108,7 +108,7 @@ jobs: - name: Run Test Suite (vulkan) run: | export LOVE_GRAPHICS_DEBUG=1 - xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua --runAllTests --renderers vulkan + ./love-${{ github.sha }}.AppImage ./testing/main.lua --runAllTests --renderers vulkan - name: Love Test Report (vulkan) uses: ellraiser/love-test-report@main with: @@ -297,9 +297,12 @@ jobs: - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install + - name: Checkout + uses: actions/checkout@v3 - name: Run Tests (opengl) if: steps.vars.outputs.arch != 'ARM64' run: | + echo 'check dir' dir powershell.exe ./install/lovec.exe ./testing/main.lua # windows opengl test diff --git a/testing/tests/audio.lua b/testing/tests/audio.lua index f1450d577..436d5b6e7 100644 --- a/testing/tests/audio.lua +++ b/testing/tests/audio.lua @@ -29,14 +29,14 @@ love.test.audio.RecordingDevice = function(test) -- start recording for a short time -- @TODO needs delay for VMs local startrecording = device:start(32000, 4000, 16, 1) - test:waitFrames(120) + test:waitFrames(10) test:assertEquals(true, startrecording, 'check recording started') test:assertEquals(true, device:isRecording(), 'check now recording') test:assertEquals(4000, device:getSampleRate(), 'check sample rate set') test:assertEquals(16, device:getBitDepth(), 'check bit depth set') test:assertEquals(1, device:getChannelCount(), 'check channel count set') local recording = device:stop() - test:waitFrames(120) + test:waitFrames(10) -- after recording test:assertEquals(false, device:isRecording(), 'check not recording') test:assertEquals(nil, device:getData(), 'using stop should clear buffer') diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index 53f229bc5..43b389fa4 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -10,49 +10,7 @@ -- Canvas (love.graphics.newCanvas) love.test.graphics.Canvas = function(test) - -- create canvas - local canvas = love.graphics.newCanvas(32, 32, { - - }) - test:assertObject(canvas) - -- check basic properties - test:assertNotNil(canvas:getMSAA()) - test:assertEquals('none', canvas:getMipmapMode(), 'check default mipmap') - --[[ - - Texture:getDPIScale check not nil - Texture:getDepth check >= 0 - Texture:getDimensions w, h - - Texture:getFormat (list of vals) - Texture:getHeight h - Texture:getLayerCount >= 0 - Texture:getMipmapCount >= 1 - Texture:getPixelDimensions w, h + dpi - Texture:getPixelHeight h + dpi - Texture:getPixelWidth w + dpi - Texture:getTextureType teture types (4 types) - Texture:getWidth w - Texture:isReadable true unless stencil/depth pixel formats - - Texture:getWrap - Texture:setWrap horiz, vert, depth - - Texture:getDepthSampleMode - Texture:setDepthSampleMode compare (list of vals) - - Texture:getFilter - Texture:setFilter min, mag, anisotrop - - Texture:getMipmapFilter - Texture:setMipmapFilter mode, sharpness - ]] - -- check rendering - canvas:renderTo(function() - - end) - local data = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16}) - -- check some pixels + test:skipTest('test class needs writing') end From a9a550745551018adf31c30cf5b83cce934b9308 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:52:04 +0000 Subject: [PATCH 22/54] add missing linux lib req --- .github/workflows/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20e108c56..75d060d9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,12 +20,14 @@ jobs: libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ - vulkan-validationlayers + vulkan-validationlayers libcurl4-openssl-dev - name: Checkout love-appimage-source uses: actions/checkout@v3 with: repository: love2d/love-appimage-source ref: 12.x + - name: Checkout Repo + uses: actions/checkout@v3 - name: Checkout LÖVE uses: actions/checkout@v3 with: @@ -70,7 +72,9 @@ jobs: echo "OPENBOXPID=$!" >> $GITHUB_ENV # linux opengl tests - name: Run All Tests (opengl) - run: ./love-${{ github.sha }}.AppImage ./testing/main.lua + run: | + ls + ./love-${{ github.sha }}.AppImage ./testing/main.lua - name: Love Test Report (opengl) uses: ellraiser/love-test-report@main with: @@ -223,6 +227,8 @@ jobs: result = subprocess.run("git -C megasource rev-parse HEAD".split(), check=True, capture_output=True, encoding="UTF-8") commit = result.stdout.split()[0] with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}") + - name: Checkout + uses: actions/checkout@v3 - name: Checkout uses: actions/checkout@v3 with: @@ -297,7 +303,6 @@ jobs: - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - - name: Checkout uses: actions/checkout@v3 - name: Run Tests (opengl) if: steps.vars.outputs.arch != 'ARM64' From 75c2667c53a01a4066c0a958536794b3f7bb2a88 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:53:13 +0000 Subject: [PATCH 23/54] Update main.yml --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75d060d9f..934a6f2fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -303,7 +303,6 @@ jobs: - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install - uses: actions/checkout@v3 - name: Run Tests (opengl) if: steps.vars.outputs.arch != 'ARM64' run: | From c682ba15d90c9a66696608c1e4373c6b51b9aac8 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:01:34 +0000 Subject: [PATCH 24/54] use 12.0dev workflow --- .github/workflows/main.yml | 202 +-------------- .github/workflows/testsuite.yml | 445 ++++++++++++++++++++++++++++++++ 2 files changed, 448 insertions(+), 199 deletions(-) create mode 100644 .github/workflows/testsuite.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 934a6f2fd..f3922d769 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,10 +3,7 @@ on: [push, pull_request] jobs: linux-os: - runs-on: ubuntu-22.04 - env: - ALSOFT_CONF: resources/alsoft.conf - DISPLAY: :99 + runs-on: ubuntu-20.04 steps: - name: Update APT run: sudo apt-get update @@ -19,15 +16,12 @@ jobs: libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ - libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ - vulkan-validationlayers libcurl4-openssl-dev + libcurl4-openssl-dev - name: Checkout love-appimage-source uses: actions/checkout@v3 with: repository: love2d/love-appimage-source ref: 12.x - - name: Checkout Repo - uses: actions/checkout@v3 - name: Checkout LÖVE uses: actions/checkout@v3 with: @@ -56,89 +50,8 @@ jobs: with: name: love-x86_64-AppImage-debug path: love-${{ github.sha }}.AppImage-debug.tar.gz - - name: Make Runnable - run: | - chmod a+x love-${{ github.sha }}.AppImage - echo "ready to run" - ls - - name: Start xvfb and openbox - run: | - echo "Starting XVFB on $DISPLAY" - Xvfb $DISPLAY -screen 0, 360x240x24 & - echo "XVFBPID=$!" >> $GITHUB_ENV - # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) - sleep 3 - openbox & - echo "OPENBOXPID=$!" >> $GITHUB_ENV - # linux opengl tests - - name: Run All Tests (opengl) - run: | - ls - ./love-${{ github.sha }}.AppImage ./testing/main.lua - - name: Love Test Report (opengl) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-opengl - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengl) - run: | - 7z a -tzip test-output-linux-opengl.zip testing/output/ - - name: Artifact Test Output (opengl) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-opengl - path: test-output-linux-opengl.zip - # linux opengles tests - - name: Run Test Suite (opengles) - run: | - export LOVE_GRAPHICS_USE_OPENGLES=1 - ./love-${{ github.sha }}.AppImage ./testing/main.lua - - name: Love Test Report (opengles) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-opengles - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengles) - run: | - 7z a -tzip test-output-linux-opengles.zip testing/output/ - - name: Artifact Test Output (opengles) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-opengles - path: test-output-linux-opengles.zip - # linux vulkan tests - - name: Run Test Suite (vulkan) - run: | - export LOVE_GRAPHICS_DEBUG=1 - ./love-${{ github.sha }}.AppImage ./testing/main.lua --runAllTests --renderers vulkan - - name: Love Test Report (vulkan) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-vulkan - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (vulkan) - run: | - 7z a -tzip test-output-linux-vulkan.zip testing/output/ - - name: Artifact Test Output (vulkan) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-vulkan - path: test-output-linux-vulkan.zip - - name: Stop xvfb and openbox - # should always stop xvfb and openbox even if other steps failed - if: always() - run: | - kill $XVFBPID - kill $OPENBOXPID windows-os: runs-on: windows-latest - env: - ALSOFT_CONF: resources/alsoft.conf - VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json - VULKAN_SDK: C:/VulkanSDK/1.3.231.1 strategy: matrix: platform: [Win32, x64, ARM64] @@ -227,8 +140,6 @@ jobs: result = subprocess.run("git -C megasource rev-parse HEAD".split(), check=True, capture_output=True, encoding="UTF-8") commit = result.stdout.split()[0] with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}") - - name: Checkout - uses: actions/checkout@v3 - name: Checkout uses: actions/checkout@v3 with: @@ -294,97 +205,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg - path: pdb/Release/*.pdb - - name: Install Mesa - run: | - curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z - 7z x mesa.7z -o* - powershell.exe mesa\systemwidedeploy.cmd 1 - - name: Build Test Exe - if: steps.vars.outputs.arch != 'ARM64' - run: cmake --build build --config Release --target install - - name: Run Tests (opengl) - if: steps.vars.outputs.arch != 'ARM64' - run: | - echo 'check dir' - dir - powershell.exe ./install/lovec.exe ./testing/main.lua - # windows opengl test - - name: Love Test Report (opengl) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (opengl) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengl) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-opengl.zip testing/output/ - - name: Artifact Test Output (opengl) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-opengl - path: test-output-windows-opengl.zip - # windows opengles test - - name: Run Tests (opengles) - if: steps.vars.outputs.arch != 'ARM64' - run: | - $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 - powershell.exe ./install/lovec.exe ./testing/main.lua - - name: Love Test Report (opengles) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (opengles) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengles) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-opengles.zip testing/output/ - - name: Artifact Test Output (opengles) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-opengles - path: test-output-windows-opengles.zip - - name: Install Vulkan - if: steps.vars.outputs.arch != 'ARM64' - run: | - curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe - ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma - curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip - 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" - reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 - powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary - # windows vulkan tests - - name: Run Tests (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - run: | - $ENV:LOVE_GRAPHICS_DEBUG=1 - powershell.exe ./install/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan - - name: Love Test Report (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (vulkan) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-vulkan.zip testing/output - - name: Artifact Test Output (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-vulkan - path: test-output-windows-vulkan.zip + path: pdb/Release/*.pdb macOS: runs-on: macos-latest steps: @@ -413,23 +234,6 @@ jobs: with: name: love-macos path: love-macos.zip - # macos opengl tests - - name: Run Tests - run: love-macos/love.app/Contents/MacOS/love testing/main.lua - - name: Love Test Report - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite MacOS - title: test-report-macos - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output - run: | - 7z a -tzip test-output-macos-opengl.zip testing/output/ - - name: Artifact Test Output - uses: actions/upload-artifact@v3 - with: - name: test-output-macos-opengl - path: test-output-macos-opengl.zip iOS-Simulator: runs-on: macos-latest steps: diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml new file mode 100644 index 000000000..2ca8483d1 --- /dev/null +++ b/.github/workflows/testsuite.yml @@ -0,0 +1,445 @@ +name: continuous-integration +on: [push, pull_request] + +jobs: + linux-os: + runs-on: ubuntu-22.04 + env: + ALSOFT_CONF: resources/alsoft.conf + DISPLAY: :99 + steps: + - name: Update APT + run: sudo apt-get update + - name: Install Dependencies + run: | + sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \ + libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \ + libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ + libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ + libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ + libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ + libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ + libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ + vulkan-validationlayers libcurl4-openssl-dev + - name: Checkout love-appimage-source + uses: actions/checkout@v3 + with: + repository: love2d/love-appimage-source + ref: 12.x + - name: Checkout LÖVE + uses: actions/checkout@v3 + with: + path: love2d-${{ github.sha }} + - name: Get Dependencies for AppImage + shell: python + env: + LOVE_BRANCH: ${{ github.sha }} + run: | + import os + for i in range(250): + if os.system(f"make getdeps LOVE_BRANCH={os.environ['LOVE_BRANCH']}") == 0: + raise SystemExit(0) + raise Exception("make getdeps failed") + - name: Build AppImage + run: make LOVE_BRANCH=${{ github.sha }} + - name: Print LuaJIT branch + run: git -C LuaJIT-v2.1 branch -v + - name: Artifact + uses: actions/upload-artifact@v3 + with: + name: love-linux-x86_64.AppImage + path: love-${{ github.sha }}.AppImage + - name: Artifact Debug Symbols + uses: actions/upload-artifact@v3 + with: + name: love-x86_64-AppImage-debug + path: love-${{ github.sha }}.AppImage-debug.tar.gz + - name: Make Runnable + run: | + chmod a+x love-${{ github.sha }}.AppImage + echo "ready to run" + ls + - name: Start xvfb and openbox + run: | + echo "Starting XVFB on $DISPLAY" + Xvfb $DISPLAY -screen 0, 360x240x24 & + echo "XVFBPID=$!" >> $GITHUB_ENV + # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) + sleep 3 + openbox & + echo "OPENBOXPID=$!" >> $GITHUB_ENV + # linux opengl tests + - name: Run All Tests (opengl) + run: | + ls + ./love-${{ github.sha }}.AppImage ./testing/main.lua + - name: Love Test Report (opengl) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-opengl + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengl) + run: | + 7z a -tzip test-output-linux-opengl.zip testing/output/ + - name: Artifact Test Output (opengl) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-opengl + path: test-output-linux-opengl.zip + # linux opengles tests + - name: Run Test Suite (opengles) + run: | + export LOVE_GRAPHICS_USE_OPENGLES=1 + ./love-${{ github.sha }}.AppImage ./testing/main.lua + - name: Love Test Report (opengles) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-opengles + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengles) + run: | + 7z a -tzip test-output-linux-opengles.zip testing/output/ + - name: Artifact Test Output (opengles) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-opengles + path: test-output-linux-opengles.zip + # linux vulkan tests + - name: Run Test Suite (vulkan) + run: | + export LOVE_GRAPHICS_DEBUG=1 + ./love-${{ github.sha }}.AppImage ./testing/main.lua --runAllTests --renderers vulkan + - name: Love Test Report (vulkan) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-vulkan + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (vulkan) + run: | + 7z a -tzip test-output-linux-vulkan.zip testing/output/ + - name: Artifact Test Output (vulkan) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-vulkan + path: test-output-linux-vulkan.zip + - name: Stop xvfb and openbox + # should always stop xvfb and openbox even if other steps failed + if: always() + run: | + kill $XVFBPID + kill $OPENBOXPID + windows-os: + runs-on: windows-latest + env: + ALSOFT_CONF: resources/alsoft.conf + VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json + VULKAN_SDK: C:/VulkanSDK/1.3.231.1 + strategy: + matrix: + platform: [Win32, x64, ARM64] + install: [compat, modern] + exclude: + - platform: ARM64 + install: compat + defaults: + run: + shell: cmd + continue-on-error: ${{ matrix.platform == 'ARM64' }} + steps: + - name: Define Variables + id: vars + run: | + rem Compat/Modern switch + if "${{ matrix.install }}" == "compat" ( + echo moredef=-DLOVE_INSTALL_UCRT=ON>> "%GITHUB_OUTPUT%" + echo compatname=-compat>> "%GITHUB_OUTPUT%" + ) else ( + echo moredef=>> "%GITHUB_OUTPUT%" + echo compatname=>> "%GITHUB_OUTPUT%" + ) + + rem JIT Modules + if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" ( + (echo jitmodules=1)>> "%GITHUB_OUTPUT%" + ) else ( + (echo jitmodules=0)>> "%GITHUB_OUTPUT%" + ) + + rem Architecture-Specific Switch + goto ${{ matrix.platform }} + exit /b 1 + + :Win32 + (echo arch=x86)>> "%GITHUB_OUTPUT%" + (echo angle=0)>> "%GITHUB_OUTPUT%" + echo nofiles=warn>> "%GITHUB_OUTPUT%" + exit /b 0 + + :x64 + (echo arch=x64)>> "%GITHUB_OUTPUT%" + (echo angle=0)>> "%GITHUB_OUTPUT%" + echo nofiles=warn>> "%GITHUB_OUTPUT%" + exit /b 0 + + :ARM64 + (echo arch=arm64)>> "%GITHUB_OUTPUT%" + (echo angle=1)>> "%GITHUB_OUTPUT%" + echo nofiles=ignore>> "%GITHUB_OUTPUT%" + echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%" + exit /b 0 + - name: Download Windows SDK Setup 10.0.20348 + run: curl -Lo winsdksetup.exe https://go.microsoft.com/fwlink/?linkid=2164145 + - name: Install Debugging Tools for Windows + id: windbg + run: | + setlocal enabledelayedexpansion + start /WAIT %CD%\winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q /log %CD%\log.txt + echo ERRORLEVEL=!ERRORLEVEL! >> %GITHUB_OUTPUT% + - name: Print Debugging Tools Install Log + if: always() + run: | + type log.txt + exit /b ${{ steps.windbg.outputs.ERRORLEVEL }} + - name: Setup Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Download source_index.py + run: curl -Lo source_index.py https://gist.github.com/MikuAuahDark/d9c099f5714e09a765496471c2827a55/raw/df34956052035f3473c5f01861dfb53930d06843/source_index.py + - name: Clone Megasource + uses: actions/checkout@v3 + with: + path: megasource + repository: love2d/megasource + ref: 12.x + - id: megasource + name: Get Megasource Commit SHA + shell: python + run: | + import os + import subprocess + + result = subprocess.run("git -C megasource rev-parse HEAD".split(), check=True, capture_output=True, encoding="UTF-8") + commit = result.stdout.split()[0] + with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}") + - name: Checkout + uses: actions/checkout@v3 + with: + path: megasource/libs/love + - name: Download ANGLE + uses: robinraju/release-downloader@v1.7 + if: steps.vars.outputs.angle == '1' + with: + repository: MikuAuahDark/angle-winbuild + tag: cr_5249 + fileName: angle-win-${{ steps.vars.outputs.arch }}.zip + tarBall: false + zipBall: false + out-file-path: angle + - name: Extract ANGLE + if: steps.vars.outputs.angle == '1' + working-directory: angle + run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip + - name: Delete Strawbery Perl + # https://github.com/actions/runner-images/issues/6627 + # In particular, this is not pretty, but even CMAKE_IGNORE_PREFIX_PATH + # cannot help in this case. Delete the whole folder! + run: | + rmdir /s /q C:\Strawberry + exit /b 0 + - name: Configure + env: + CFLAGS: /Zi + CXXFLAGS: /Zi + LDFLAGS: /DEBUG:FULL /OPT:REF /OPT:ICF + run: cmake -Bbuild -Smegasource -T v142 -A ${{ matrix.platform }} --install-prefix %CD%\install -DCMAKE_PDB_OUTPUT_DIRECTORY=%CD%\pdb ${{ steps.vars.outputs.moredef }} + - name: Install + run: cmake --build build --target PACKAGE --config Release -j2 + - name: Copy LuaJIT lua51.pdb + run: | + copy /Y build\libs\LuaJIT\src\lua51.pdb pdb\Release\lua51.pdb + exit /b 0 + - name: Add srcsrv to PATH + run: | + echo C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv>>%GITHUB_PATH% + - name: Embed Source Index into PDBs + run: | + python source_index.py ^ + --source %CD%\megasource\libs\love https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }} ^ + --source %CD%\megasource https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }} ^ + --source %CD%\build\libs\LuaJIT https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }}/libs/LuaJIT ^ + pdb\Release\*.pdb + - name: Artifact + uses: actions/upload-artifact@v3 + with: + name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }} + path: | + build/*.zip + build/*.exe + if-no-files-found: ${{ steps.vars.outputs.nofiles }} + - name: Artifact JIT Modules + if: steps.vars.outputs.jitmodules == '1' + uses: actions/upload-artifact@v3 + with: + name: love-windows-jitmodules + path: build/libs/LuaJIT/src/jit/*.lua + - name: Artifact PDB + uses: actions/upload-artifact@v3 + with: + name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg + path: pdb/Release/*.pdb + - name: Install Mesa + run: | + curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z + 7z x mesa.7z -o* + powershell.exe mesa\systemwidedeploy.cmd 1 + - name: Build Test Exe + if: steps.vars.outputs.arch != 'ARM64' + run: cmake --build build --config Release --target install + - name: Run Tests (opengl) + if: steps.vars.outputs.arch != 'ARM64' + run: | + echo 'check dir' + dir + powershell.exe ./install/lovec.exe ./testing/main.lua + # windows opengl test + - name: Love Test Report (opengl) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (opengl) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengl) + if: steps.vars.outputs.arch != 'ARM64' + run: | + 7z a -tzip test-output-windows-opengl.zip testing/output/ + - name: Artifact Test Output (opengl) + if: steps.vars.outputs.arch != 'ARM64' + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-opengl + path: test-output-windows-opengl.zip + # windows opengles test + - name: Run Tests (opengles) + if: steps.vars.outputs.arch != 'ARM64' + run: | + $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 + powershell.exe ./install/lovec.exe ./testing/main.lua + - name: Love Test Report (opengles) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (opengles) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengles) + if: steps.vars.outputs.arch != 'ARM64' + run: | + 7z a -tzip test-output-windows-opengles.zip testing/output/ + - name: Artifact Test Output (opengles) + if: steps.vars.outputs.arch != 'ARM64' + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-opengles + path: test-output-windows-opengles.zip + - name: Install Vulkan + if: steps.vars.outputs.arch != 'ARM64' + run: | + curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe + ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma + curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip + 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" + reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 + powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary + # windows vulkan tests + - name: Run Tests (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + run: | + $ENV:LOVE_GRAPHICS_DEBUG=1 + powershell.exe ./install/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan + - name: Love Test Report (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (vulkan) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + run: | + 7z a -tzip test-output-windows-vulkan.zip testing/output + - name: Artifact Test Output (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-vulkan + path: test-output-windows-vulkan.zip + macOS: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Clone Dependencies + uses: actions/checkout@v3 + with: + path: apple-dependencies + repository: love2d/love-apple-dependencies + ref: 12.x + - name: Move Dependencies + run: + mv apple-dependencies/macOS/Frameworks platform/xcode/macosx + - name: Build + run: + xcodebuild clean archive -project platform/xcode/love.xcodeproj -scheme love-macosx -configuration Release -archivePath love-macos.xcarchive + - name: Export Archive + run: + xcodebuild -exportArchive -archivePath love-macos.xcarchive -exportPath love-macos -exportOptionsPlist platform/xcode/macosx/macos-copy-app.plist + - name: Zip Archive + run: + ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip + - name: Artifact + uses: actions/upload-artifact@v3 + with: + name: love-macos + path: love-macos.zip + # macos opengl tests + - name: Run Tests + run: love-macos/love.app/Contents/MacOS/love testing/main.lua + - name: Love Test Report + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite MacOS + title: test-report-macos + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output + run: | + 7z a -tzip test-output-macos-opengl.zip testing/output/ + - name: Artifact Test Output + uses: actions/upload-artifact@v3 + with: + name: test-output-macos-opengl + path: test-output-macos-opengl.zip + iOS-Simulator: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Clone Dependencies + uses: actions/checkout@v3 + with: + path: apple-dependencies + repository: love2d/love-apple-dependencies + ref: 12.x + - name: Move Dependencies + run: | + mv apple-dependencies/iOS/libraries platform/xcode/ios + - name: Build + run: + xcodebuild -project platform/xcode/love.xcodeproj -scheme love-ios -configuration Release -destination 'platform=iOS Simulator,name=iPhone 11' From d23c3968133ff21415548ad0cede403f7f487937 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:15:37 +0000 Subject: [PATCH 25/54] split workflow --- .github/workflows/testsuite.yml | 452 +------------------------------- 1 file changed, 12 insertions(+), 440 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 2ca8483d1..4590ad5b2 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -1,445 +1,17 @@ -name: continuous-integration -on: [push, pull_request] +name: testsuite + +on: + workflow_run: + workflows: ["continuous-integration"] + types: + - completed jobs: - linux-os: - runs-on: ubuntu-22.04 - env: - ALSOFT_CONF: resources/alsoft.conf - DISPLAY: :99 - steps: - - name: Update APT - run: sudo apt-get update - - name: Install Dependencies - run: | - sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \ - libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \ - libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ - libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ - libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ - libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ - libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ - libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ - vulkan-validationlayers libcurl4-openssl-dev - - name: Checkout love-appimage-source - uses: actions/checkout@v3 - with: - repository: love2d/love-appimage-source - ref: 12.x - - name: Checkout LÖVE - uses: actions/checkout@v3 - with: - path: love2d-${{ github.sha }} - - name: Get Dependencies for AppImage - shell: python - env: - LOVE_BRANCH: ${{ github.sha }} - run: | - import os - for i in range(250): - if os.system(f"make getdeps LOVE_BRANCH={os.environ['LOVE_BRANCH']}") == 0: - raise SystemExit(0) - raise Exception("make getdeps failed") - - name: Build AppImage - run: make LOVE_BRANCH=${{ github.sha }} - - name: Print LuaJIT branch - run: git -C LuaJIT-v2.1 branch -v - - name: Artifact - uses: actions/upload-artifact@v3 - with: - name: love-linux-x86_64.AppImage - path: love-${{ github.sha }}.AppImage - - name: Artifact Debug Symbols - uses: actions/upload-artifact@v3 - with: - name: love-x86_64-AppImage-debug - path: love-${{ github.sha }}.AppImage-debug.tar.gz - - name: Make Runnable - run: | - chmod a+x love-${{ github.sha }}.AppImage - echo "ready to run" - ls - - name: Start xvfb and openbox - run: | - echo "Starting XVFB on $DISPLAY" - Xvfb $DISPLAY -screen 0, 360x240x24 & - echo "XVFBPID=$!" >> $GITHUB_ENV - # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) - sleep 3 - openbox & - echo "OPENBOXPID=$!" >> $GITHUB_ENV - # linux opengl tests - - name: Run All Tests (opengl) - run: | - ls - ./love-${{ github.sha }}.AppImage ./testing/main.lua - - name: Love Test Report (opengl) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-opengl - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengl) - run: | - 7z a -tzip test-output-linux-opengl.zip testing/output/ - - name: Artifact Test Output (opengl) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-opengl - path: test-output-linux-opengl.zip - # linux opengles tests - - name: Run Test Suite (opengles) - run: | - export LOVE_GRAPHICS_USE_OPENGLES=1 - ./love-${{ github.sha }}.AppImage ./testing/main.lua - - name: Love Test Report (opengles) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-opengles - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengles) - run: | - 7z a -tzip test-output-linux-opengles.zip testing/output/ - - name: Artifact Test Output (opengles) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-opengles - path: test-output-linux-opengles.zip - # linux vulkan tests - - name: Run Test Suite (vulkan) - run: | - export LOVE_GRAPHICS_DEBUG=1 - ./love-${{ github.sha }}.AppImage ./testing/main.lua --runAllTests --renderers vulkan - - name: Love Test Report (vulkan) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-vulkan - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (vulkan) - run: | - 7z a -tzip test-output-linux-vulkan.zip testing/output/ - - name: Artifact Test Output (vulkan) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-vulkan - path: test-output-linux-vulkan.zip - - name: Stop xvfb and openbox - # should always stop xvfb and openbox even if other steps failed - if: always() - run: | - kill $XVFBPID - kill $OPENBOXPID - windows-os: - runs-on: windows-latest - env: - ALSOFT_CONF: resources/alsoft.conf - VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json - VULKAN_SDK: C:/VulkanSDK/1.3.231.1 - strategy: - matrix: - platform: [Win32, x64, ARM64] - install: [compat, modern] - exclude: - - platform: ARM64 - install: compat - defaults: - run: - shell: cmd - continue-on-error: ${{ matrix.platform == 'ARM64' }} - steps: - - name: Define Variables - id: vars - run: | - rem Compat/Modern switch - if "${{ matrix.install }}" == "compat" ( - echo moredef=-DLOVE_INSTALL_UCRT=ON>> "%GITHUB_OUTPUT%" - echo compatname=-compat>> "%GITHUB_OUTPUT%" - ) else ( - echo moredef=>> "%GITHUB_OUTPUT%" - echo compatname=>> "%GITHUB_OUTPUT%" - ) - - rem JIT Modules - if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" ( - (echo jitmodules=1)>> "%GITHUB_OUTPUT%" - ) else ( - (echo jitmodules=0)>> "%GITHUB_OUTPUT%" - ) - - rem Architecture-Specific Switch - goto ${{ matrix.platform }} - exit /b 1 - - :Win32 - (echo arch=x86)>> "%GITHUB_OUTPUT%" - (echo angle=0)>> "%GITHUB_OUTPUT%" - echo nofiles=warn>> "%GITHUB_OUTPUT%" - exit /b 0 - - :x64 - (echo arch=x64)>> "%GITHUB_OUTPUT%" - (echo angle=0)>> "%GITHUB_OUTPUT%" - echo nofiles=warn>> "%GITHUB_OUTPUT%" - exit /b 0 - - :ARM64 - (echo arch=arm64)>> "%GITHUB_OUTPUT%" - (echo angle=1)>> "%GITHUB_OUTPUT%" - echo nofiles=ignore>> "%GITHUB_OUTPUT%" - echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%" - exit /b 0 - - name: Download Windows SDK Setup 10.0.20348 - run: curl -Lo winsdksetup.exe https://go.microsoft.com/fwlink/?linkid=2164145 - - name: Install Debugging Tools for Windows - id: windbg - run: | - setlocal enabledelayedexpansion - start /WAIT %CD%\winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q /log %CD%\log.txt - echo ERRORLEVEL=!ERRORLEVEL! >> %GITHUB_OUTPUT% - - name: Print Debugging Tools Install Log - if: always() - run: | - type log.txt - exit /b ${{ steps.windbg.outputs.ERRORLEVEL }} - - name: Setup Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Download source_index.py - run: curl -Lo source_index.py https://gist.github.com/MikuAuahDark/d9c099f5714e09a765496471c2827a55/raw/df34956052035f3473c5f01861dfb53930d06843/source_index.py - - name: Clone Megasource - uses: actions/checkout@v3 - with: - path: megasource - repository: love2d/megasource - ref: 12.x - - id: megasource - name: Get Megasource Commit SHA - shell: python - run: | - import os - import subprocess - - result = subprocess.run("git -C megasource rev-parse HEAD".split(), check=True, capture_output=True, encoding="UTF-8") - commit = result.stdout.split()[0] - with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}") - - name: Checkout - uses: actions/checkout@v3 - with: - path: megasource/libs/love - - name: Download ANGLE - uses: robinraju/release-downloader@v1.7 - if: steps.vars.outputs.angle == '1' - with: - repository: MikuAuahDark/angle-winbuild - tag: cr_5249 - fileName: angle-win-${{ steps.vars.outputs.arch }}.zip - tarBall: false - zipBall: false - out-file-path: angle - - name: Extract ANGLE - if: steps.vars.outputs.angle == '1' - working-directory: angle - run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip - - name: Delete Strawbery Perl - # https://github.com/actions/runner-images/issues/6627 - # In particular, this is not pretty, but even CMAKE_IGNORE_PREFIX_PATH - # cannot help in this case. Delete the whole folder! - run: | - rmdir /s /q C:\Strawberry - exit /b 0 - - name: Configure - env: - CFLAGS: /Zi - CXXFLAGS: /Zi - LDFLAGS: /DEBUG:FULL /OPT:REF /OPT:ICF - run: cmake -Bbuild -Smegasource -T v142 -A ${{ matrix.platform }} --install-prefix %CD%\install -DCMAKE_PDB_OUTPUT_DIRECTORY=%CD%\pdb ${{ steps.vars.outputs.moredef }} - - name: Install - run: cmake --build build --target PACKAGE --config Release -j2 - - name: Copy LuaJIT lua51.pdb - run: | - copy /Y build\libs\LuaJIT\src\lua51.pdb pdb\Release\lua51.pdb - exit /b 0 - - name: Add srcsrv to PATH - run: | - echo C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv>>%GITHUB_PATH% - - name: Embed Source Index into PDBs - run: | - python source_index.py ^ - --source %CD%\megasource\libs\love https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }} ^ - --source %CD%\megasource https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }} ^ - --source %CD%\build\libs\LuaJIT https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }}/libs/LuaJIT ^ - pdb\Release\*.pdb - - name: Artifact - uses: actions/upload-artifact@v3 - with: - name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }} - path: | - build/*.zip - build/*.exe - if-no-files-found: ${{ steps.vars.outputs.nofiles }} - - name: Artifact JIT Modules - if: steps.vars.outputs.jitmodules == '1' - uses: actions/upload-artifact@v3 - with: - name: love-windows-jitmodules - path: build/libs/LuaJIT/src/jit/*.lua - - name: Artifact PDB - uses: actions/upload-artifact@v3 - with: - name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg - path: pdb/Release/*.pdb - - name: Install Mesa - run: | - curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z - 7z x mesa.7z -o* - powershell.exe mesa\systemwidedeploy.cmd 1 - - name: Build Test Exe - if: steps.vars.outputs.arch != 'ARM64' - run: cmake --build build --config Release --target install - - name: Run Tests (opengl) - if: steps.vars.outputs.arch != 'ARM64' - run: | - echo 'check dir' - dir - powershell.exe ./install/lovec.exe ./testing/main.lua - # windows opengl test - - name: Love Test Report (opengl) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (opengl) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengl) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-opengl.zip testing/output/ - - name: Artifact Test Output (opengl) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-opengl - path: test-output-windows-opengl.zip - # windows opengles test - - name: Run Tests (opengles) - if: steps.vars.outputs.arch != 'ARM64' - run: | - $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 - powershell.exe ./install/lovec.exe ./testing/main.lua - - name: Love Test Report (opengles) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (opengles) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (opengles) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-opengles.zip testing/output/ - - name: Artifact Test Output (opengles) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-opengles - path: test-output-windows-opengles.zip - - name: Install Vulkan - if: steps.vars.outputs.arch != 'ARM64' - run: | - curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe - ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma - curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip - 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" - reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 - powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary - # windows vulkan tests - - name: Run Tests (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - run: | - $ENV:LOVE_GRAPHICS_DEBUG=1 - powershell.exe ./install/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan - - name: Love Test Report (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows (vulkan) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-vulkan.zip testing/output - - name: Artifact Test Output (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-vulkan - path: test-output-windows-vulkan.zip - macOS: - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Clone Dependencies - uses: actions/checkout@v3 - with: - path: apple-dependencies - repository: love2d/love-apple-dependencies - ref: 12.x - - name: Move Dependencies - run: - mv apple-dependencies/macOS/Frameworks platform/xcode/macosx - - name: Build - run: - xcodebuild clean archive -project platform/xcode/love.xcodeproj -scheme love-macosx -configuration Release -archivePath love-macos.xcarchive - - name: Export Archive - run: - xcodebuild -exportArchive -archivePath love-macos.xcarchive -exportPath love-macos -exportOptionsPlist platform/xcode/macosx/macos-copy-app.plist - - name: Zip Archive - run: - ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip - - name: Artifact - uses: actions/upload-artifact@v3 - with: - name: love-macos - path: love-macos.zip - # macos opengl tests - - name: Run Tests - run: love-macos/love.app/Contents/MacOS/love testing/main.lua - - name: Love Test Report - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite MacOS - title: test-report-macos - path: testing/output/lovetest_runAllTests.md - - name: Zip Test Output - run: | - 7z a -tzip test-output-macos-opengl.zip testing/output/ - - name: Artifact Test Output - uses: actions/upload-artifact@v3 - with: - name: test-output-macos-opengl - path: test-output-macos-opengl.zip - iOS-Simulator: + macos-latest: runs-on: macos-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Clone Dependencies - uses: actions/checkout@v3 + - name: Download artifact + uses: dawidd6/action-download-artifact@v2 with: - path: apple-dependencies - repository: love2d/love-apple-dependencies - ref: 12.x - - name: Move Dependencies - run: | - mv apple-dependencies/iOS/libraries platform/xcode/ios - - name: Build - run: - xcodebuild -project platform/xcode/love.xcodeproj -scheme love-ios -configuration Release -destination 'platform=iOS Simulator,name=iPhone 11' + workflow: ${{ github.event.workflow_run.workflow_id }} + workflow_conclusion: success From 58fa1c8ccddeb09bceaefedebb80782b52ae005f Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:34:53 +0000 Subject: [PATCH 26/54] test the test workflow --- .github/workflows/testsuite.yml | 264 +++++++++++++++++++++++++++++++- 1 file changed, 261 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 4590ad5b2..d0f3fe77f 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -1,5 +1,4 @@ name: testsuite - on: workflow_run: workflows: ["continuous-integration"] @@ -10,8 +9,267 @@ jobs: macos-latest: runs-on: macos-latest steps: - - name: Download artifact + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Download Artifacts From CI + uses: dawidd6/action-download-artifact@v2 + with: + workflow: main.yaml + workflow_conclusion: success + name: love-macos + - name: Unzip Love + run: + echo 'check downloaded' + ls +# - name: Run Test Suite +# run: CHECK_PATH/love.app/Contents/MacOS/love ./testing/main.lua +# - name: Love Test Report +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite MacOS +# title: test-report-macos +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output +# run: | +# 7z a -tzip test-output-macos-opengl.zip output/ +# - name: Artifact Test Output +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-macos-opengl +# path: test-output-macos-opengl.zip + windows-latest: + runs-on: windows-latest + env: + ALSOFT_CONF: resources/alsoft.conf + VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json + VULKAN_SDK: C:/VulkanSDK/1.3.231.1 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Download Artifacts From CI + uses: dawidd6/action-download-artifact@v2 + with: + workflow: main.yaml + workflow_conclusion: success + name: love-windows-x64 + - name: Unzip Love + run: + echo 'check downloaded' + ls +# - name: Install Mesa +# run: | +# curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z +# 7z x mesa.7z -o* +# powershell.exe mesa\systemwidedeploy.cmd 1 +# - name: Run Tests (opengl) +# run: powershell.exe ./CHECK_PATH/lovec.exe ./testing/main.lua +# - name: Love Test Report (opengl) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Windows (opengl) +# title: test-report-windows-opengl +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output (opengl) +# run: | +# 7z a -tzip test-output-windows-opengl.zip output\ +# - name: Artifact Test Output (opengl) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-windows-opengl +# path: test-output-windows-opengl.zip +# - name: Run Tests (opengles) +# run: | +# $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 +# powershell.exe ./CHECK_PATH/lovec.exe ./testing/main.lua +# - name: Love Test Report (opengles) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Windows (opengles) +# title: test-report-windows-opengles +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output (opengles) +# run: | +# 7z a -tzip test-output-windows-opengles.zip output\ +# - name: Artifact Test Output (opengles) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-windows-opengles +# path: test-output-windows-opengles.zip +# - name: Install Vulkan +# run: | +# curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe +# ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma +# curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip +# 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 +# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" +# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" +# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" +# reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 +# powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary +# - name: Run Tests (vulkan) +# run: | +# $ENV:LOVE_GRAPHICS_DEBUG=1 +# powershell.exe ./CHECK_PATH/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan +# - name: Love Test Report (vulkan) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Windows (vulkan) +# title: test-report-windows-vulkan +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output (vulkan) +# run: | +# 7z a -tzip test-output-windows-vulkan.zip output/ +# - name: Artifact Test Output (vulkan) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-windows-vulkan +# path: test-output-windows-vulkan.zip + linux-ubuntu: + runs-on: ubuntu-20.04 + env: + ALSOFT_CONF: resources/alsoft.conf + DISPLAY: :99 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Download Artifacts From CI + uses: dawidd6/action-download-artifact@v2 + with: + workflow: main.yaml + workflow_conclusion: success + name: love-linux-x86_64.AppImage + - name: Unzip Love + run: + echo 'check downloaded' + ls + echo 'chmod a+x here' +# - name: Update APT +# run: sudo apt-get update +# - name: Install Dependencies +# run: | +# sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \ +# libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \ +# libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ +# libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ +# libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ +# libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ +# libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ +# libfuse2 wmctrl openbox +# - name: Start xvfb and openbox +# run: | +# echo "Starting XVFB on $DISPLAY" +# Xvfb $DISPLAY -screen 0, 360x240x24 & +# echo "XVFBPID=$!" >> $GITHUB_ENV +# # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) +# sleep 3 +# openbox & +# echo "OPENBOXPID=$!" >> $GITHUB_ENV +# # linux opengl tests +# - name: Run Test Suite (opengl) +# run: | +# CHECK_PATH/love12.AppImage ./testing/main.lua +# - name: Love Test Report (opengl) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Linux +# title: test-report-linux-opengl +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output (opengl) +# run: | +# 7z a -tzip test-output-linux-opengl.zip output/ +# - name: Artifact Test Output (opengl) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-linux-opengl +# path: test-output-linux-opengl.zip +# # linux opengles tests +# - name: Run Test Suite (opengles) +# run: | +# export LOVE_GRAPHICS_USE_OPENGLES=1 +# CHECK_PATH/love12.AppImage ./testing/main.lua +# - name: Love Test Report (opengles) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Linux +# title: test-report-linux-opengles +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output (opengles) +# run: | +# 7z a -tzip test-output-linux-opengles.zip output\ +# - name: Artifact Test Output (opengles) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-linux-opengles +# path: test-output-linux-opengles.zip +# - name: Stop xvfb and openbox +# # should always stop xvfb and openbox even if other steps failed +# if: always() +# run: | +# kill $XVFBPID +# kill $OPENBOXPID + linux-vulkan: + runs-on: ubuntu-22.04 + env: + ALSOFT_CONF: resources/alsoft.conf + DISPLAY: :99 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Download Artifacts From CI uses: dawidd6/action-download-artifact@v2 with: - workflow: ${{ github.event.workflow_run.workflow_id }} + workflow: main.yaml workflow_conclusion: success + name: love-linux-x86_64.AppImage + - name: Unzip Love + run: + echo 'check downloaded' + ls + echo 'chmod a+x here' +# - name: Update APT +# run: sudo apt-get update +# - name: Install Dependencies +# run: | +# sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \ +# libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \ +# libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ +# libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ +# libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ +# libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ +# libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ +# libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ +# vulkan-validationlayers +# - name: Start xvfb and openbox +# run: | +# echo "Starting XVFB on $DISPLAY" +# Xvfb $DISPLAY -screen 0, 360x240x24 & +# echo "XVFBPID=$!" >> $GITHUB_ENV +# # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) +# sleep 3 +# openbox & +# echo "OPENBOXPID=$!" >> $GITHUB_ENV +# # linux vulkan tests +# - name: Run Test Suite (vulkan) +# run: | +# export LOVE_GRAPHICS_DEBUG=1 +# CHECK_PATH/love12.AppImage ./testing/main.lua --runAllTests --renderers vulkan +# - name: Love Test Report (vulkan) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Linux +# title: test-report-linux-vulkan +# path: output/lovetest_runAllTests.md +# - name: Zip Test Output (vulkan) +# run: | +# 7z a -tzip test-output-linux-vulkan.zip output/ +# - name: Artifact Test Output (vulkan) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-linux-vulkan +# path: test-output-linux-vulkan.zip +# - name: Stop xvfb and openbox +# # should always stop xvfb and openbox even if other steps failed +# if: always() +# run: | +# kill $XVFBPID +# kill $OPENBOXPID From 0d338b0c0d3ba3e1cfea46089b4839b1028db924 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:04:49 +0000 Subject: [PATCH 27/54] workflow changes #1 --- .github/workflows/main.yml | 94 ++++++++++- .github/workflows/testsuite.yml | 275 -------------------------------- 2 files changed, 93 insertions(+), 276 deletions(-) delete mode 100644 .github/workflows/testsuite.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3922d769..d5c967d4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,9 @@ on: [push, pull_request] jobs: linux-os: runs-on: ubuntu-20.04 + env: + ALSOFT_CONF: resources/alsoft.conf + DISPLAY: :99 steps: - name: Update APT run: sudo apt-get update @@ -16,7 +19,7 @@ jobs: libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ - libcurl4-openssl-dev + libcurl4-openssl-dev libfuse2 wmctrl openbox - name: Checkout love-appimage-source uses: actions/checkout@v3 with: @@ -40,6 +43,42 @@ jobs: run: make LOVE_BRANCH=${{ github.sha }} - name: Print LuaJIT branch run: git -C LuaJIT-v2.1 branch -v + - name: Start xvfb and openbox + run: | + echo "Starting XVFB on $DISPLAY" + Xvfb $DISPLAY -screen 0, 360x240x24 & + echo "XVFBPID=$!" >> $GITHUB_ENV + # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) + sleep 3 + openbox & + echo "OPENBOXPID=$!" >> $GITHUB_ENV + # linux opengl tests + - name: Run Test Suite (opengl) + run: | + echo 'run opengl tests' + ls + ls love2d-${{ github.sha }} + chmod a+x love-${{ github.sha }}.AppImage + ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua + - name: Love Test Report (opengl) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-opengl + path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengl) + run: | + 7z a -tzip test-output-linux-opengl.zip output/ + - name: Artifact Test Output (opengl) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-opengl + - name: Stop xvfb and openbox + # should always stop xvfb and openbox even if other steps failed + if: always() + run: | + kill $XVFBPID + kill $OPENBOXPID - name: Artifact uses: actions/upload-artifact@v3 with: @@ -52,6 +91,10 @@ jobs: path: love-${{ github.sha }}.AppImage-debug.tar.gz windows-os: runs-on: windows-latest + env: + ALSOFT_CONF: resources/alsoft.conf + VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json + VULKAN_SDK: C:/VulkanSDK/1.3.231.1 strategy: matrix: platform: [Win32, x64, ARM64] @@ -206,6 +249,37 @@ jobs: with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb + - name: Install Mesa + run: | + curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z + 7z x mesa.7z -o* + powershell.exe mesa\systemwidedeploy.cmd 1 + - name: Build Test Exe + if: steps.vars.outputs.arch != 'ARM64' + run: cmake --build build --config Release --target install + - name: Run Tests (opengl) + if: steps.vars.outputs.arch != 'ARM64' + run: | + echo 'check dir' + ls + powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua + - name: Love Test Report (opengl) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (opengl) + title: test-report-windows-opengl + path: megasource/libs/love/testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengl) + if: steps.vars.outputs.arch != 'ARM64' + run: | + 7z a -tzip test-output-windows-opengl.zip output\ + - name: Artifact Test Output (opengl) + if: steps.vars.outputs.arch != 'ARM64' + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-opengl + path: test-output-windows-opengl.zip macOS: runs-on: macos-latest steps: @@ -234,6 +308,24 @@ jobs: with: name: love-macos path: love-macos.zip + - name: Run Test Suite + run: | + ls + love-macos/love.app/Contents/MacOS/love ./testing/main.lua + - name: Love Test Report + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite MacOS + title: test-report-macos + path: testing/output/lovetest_runAllTests.md + - name: Zip Test Output + run: | + 7z a -tzip test-output-macos-opengl.zip output/ + - name: Artifact Test Output + uses: actions/upload-artifact@v3 + with: + name: test-output-macos-opengl + path: test-output-macos-opengl.zip iOS-Simulator: runs-on: macos-latest steps: diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml deleted file mode 100644 index d0f3fe77f..000000000 --- a/.github/workflows/testsuite.yml +++ /dev/null @@ -1,275 +0,0 @@ -name: testsuite -on: - workflow_run: - workflows: ["continuous-integration"] - types: - - completed - -jobs: - macos-latest: - runs-on: macos-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Download Artifacts From CI - uses: dawidd6/action-download-artifact@v2 - with: - workflow: main.yaml - workflow_conclusion: success - name: love-macos - - name: Unzip Love - run: - echo 'check downloaded' - ls -# - name: Run Test Suite -# run: CHECK_PATH/love.app/Contents/MacOS/love ./testing/main.lua -# - name: Love Test Report -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite MacOS -# title: test-report-macos -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output -# run: | -# 7z a -tzip test-output-macos-opengl.zip output/ -# - name: Artifact Test Output -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-macos-opengl -# path: test-output-macos-opengl.zip - windows-latest: - runs-on: windows-latest - env: - ALSOFT_CONF: resources/alsoft.conf - VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json - VULKAN_SDK: C:/VulkanSDK/1.3.231.1 - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Download Artifacts From CI - uses: dawidd6/action-download-artifact@v2 - with: - workflow: main.yaml - workflow_conclusion: success - name: love-windows-x64 - - name: Unzip Love - run: - echo 'check downloaded' - ls -# - name: Install Mesa -# run: | -# curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z -# 7z x mesa.7z -o* -# powershell.exe mesa\systemwidedeploy.cmd 1 -# - name: Run Tests (opengl) -# run: powershell.exe ./CHECK_PATH/lovec.exe ./testing/main.lua -# - name: Love Test Report (opengl) -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite Windows (opengl) -# title: test-report-windows-opengl -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output (opengl) -# run: | -# 7z a -tzip test-output-windows-opengl.zip output\ -# - name: Artifact Test Output (opengl) -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-windows-opengl -# path: test-output-windows-opengl.zip -# - name: Run Tests (opengles) -# run: | -# $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 -# powershell.exe ./CHECK_PATH/lovec.exe ./testing/main.lua -# - name: Love Test Report (opengles) -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite Windows (opengles) -# title: test-report-windows-opengles -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output (opengles) -# run: | -# 7z a -tzip test-output-windows-opengles.zip output\ -# - name: Artifact Test Output (opengles) -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-windows-opengles -# path: test-output-windows-opengles.zip -# - name: Install Vulkan -# run: | -# curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe -# ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma -# curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip -# 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 -# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" -# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" -# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" -# reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 -# powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary -# - name: Run Tests (vulkan) -# run: | -# $ENV:LOVE_GRAPHICS_DEBUG=1 -# powershell.exe ./CHECK_PATH/lovec.exe ./testing/main.lua --runAllTests --renderers vulkan -# - name: Love Test Report (vulkan) -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite Windows (vulkan) -# title: test-report-windows-vulkan -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output (vulkan) -# run: | -# 7z a -tzip test-output-windows-vulkan.zip output/ -# - name: Artifact Test Output (vulkan) -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-windows-vulkan -# path: test-output-windows-vulkan.zip - linux-ubuntu: - runs-on: ubuntu-20.04 - env: - ALSOFT_CONF: resources/alsoft.conf - DISPLAY: :99 - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Download Artifacts From CI - uses: dawidd6/action-download-artifact@v2 - with: - workflow: main.yaml - workflow_conclusion: success - name: love-linux-x86_64.AppImage - - name: Unzip Love - run: - echo 'check downloaded' - ls - echo 'chmod a+x here' -# - name: Update APT -# run: sudo apt-get update -# - name: Install Dependencies -# run: | -# sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \ -# libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \ -# libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ -# libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ -# libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ -# libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ -# libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ -# libfuse2 wmctrl openbox -# - name: Start xvfb and openbox -# run: | -# echo "Starting XVFB on $DISPLAY" -# Xvfb $DISPLAY -screen 0, 360x240x24 & -# echo "XVFBPID=$!" >> $GITHUB_ENV -# # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) -# sleep 3 -# openbox & -# echo "OPENBOXPID=$!" >> $GITHUB_ENV -# # linux opengl tests -# - name: Run Test Suite (opengl) -# run: | -# CHECK_PATH/love12.AppImage ./testing/main.lua -# - name: Love Test Report (opengl) -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite Linux -# title: test-report-linux-opengl -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output (opengl) -# run: | -# 7z a -tzip test-output-linux-opengl.zip output/ -# - name: Artifact Test Output (opengl) -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-linux-opengl -# path: test-output-linux-opengl.zip -# # linux opengles tests -# - name: Run Test Suite (opengles) -# run: | -# export LOVE_GRAPHICS_USE_OPENGLES=1 -# CHECK_PATH/love12.AppImage ./testing/main.lua -# - name: Love Test Report (opengles) -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite Linux -# title: test-report-linux-opengles -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output (opengles) -# run: | -# 7z a -tzip test-output-linux-opengles.zip output\ -# - name: Artifact Test Output (opengles) -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-linux-opengles -# path: test-output-linux-opengles.zip -# - name: Stop xvfb and openbox -# # should always stop xvfb and openbox even if other steps failed -# if: always() -# run: | -# kill $XVFBPID -# kill $OPENBOXPID - linux-vulkan: - runs-on: ubuntu-22.04 - env: - ALSOFT_CONF: resources/alsoft.conf - DISPLAY: :99 - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Download Artifacts From CI - uses: dawidd6/action-download-artifact@v2 - with: - workflow: main.yaml - workflow_conclusion: success - name: love-linux-x86_64.AppImage - - name: Unzip Love - run: - echo 'check downloaded' - ls - echo 'chmod a+x here' -# - name: Update APT -# run: sudo apt-get update -# - name: Install Dependencies -# run: | -# sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \ -# libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \ -# libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ -# libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \ -# libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ -# libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ -# libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ -# libfuse2 wmctrl openbox mesa-vulkan-drivers libvulkan1 vulkan-tools \ -# vulkan-validationlayers -# - name: Start xvfb and openbox -# run: | -# echo "Starting XVFB on $DISPLAY" -# Xvfb $DISPLAY -screen 0, 360x240x24 & -# echo "XVFBPID=$!" >> $GITHUB_ENV -# # wait for xvfb to startup (3s is the same amount xvfb-run waits by default) -# sleep 3 -# openbox & -# echo "OPENBOXPID=$!" >> $GITHUB_ENV -# # linux vulkan tests -# - name: Run Test Suite (vulkan) -# run: | -# export LOVE_GRAPHICS_DEBUG=1 -# CHECK_PATH/love12.AppImage ./testing/main.lua --runAllTests --renderers vulkan -# - name: Love Test Report (vulkan) -# uses: ellraiser/love-test-report@main -# with: -# name: Love Testsuite Linux -# title: test-report-linux-vulkan -# path: output/lovetest_runAllTests.md -# - name: Zip Test Output (vulkan) -# run: | -# 7z a -tzip test-output-linux-vulkan.zip output/ -# - name: Artifact Test Output (vulkan) -# uses: actions/upload-artifact@v3 -# with: -# name: test-output-linux-vulkan -# path: test-output-linux-vulkan.zip -# - name: Stop xvfb and openbox -# # should always stop xvfb and openbox even if other steps failed -# if: always() -# run: | -# kill $XVFBPID -# kill $OPENBOXPID From 5155a96540bed29229ccdbc9ba90d11436ef3caa Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:18:43 +0000 Subject: [PATCH 28/54] fix upload paths --- .github/workflows/main.yml | 55 +++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5c967d4f..1e6285c0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,7 @@ jobs: run: make LOVE_BRANCH=${{ github.sha }} - name: Print LuaJIT branch run: git -C LuaJIT-v2.1 branch -v + # start xvfb for test running - name: Start xvfb and openbox run: | echo "Starting XVFB on $DISPLAY" @@ -55,9 +56,6 @@ jobs: # linux opengl tests - name: Run Test Suite (opengl) run: | - echo 'run opengl tests' - ls - ls love2d-${{ github.sha }} chmod a+x love-${{ github.sha }}.AppImage ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua - name: Love Test Report (opengl) @@ -68,11 +66,29 @@ jobs: path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md - name: Zip Test Output (opengl) run: | - 7z a -tzip test-output-linux-opengl.zip output/ + 7z a -tzip test-output-linux-opengl.zip love2d-${{ github.sha }}/testing/output/ - name: Artifact Test Output (opengl) uses: actions/upload-artifact@v3 with: name: test-output-linux-opengl + # linux opengles tests + - name: Run Test Suite (opengles) + run: | + export LOVE_GRAPHICS_USE_OPENGLES=1 + ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua + - name: Love Test Report (opengles) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-opengles + path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengles) + run: | + 7z a -tzip test-output-linux-opengles.zip love2d-${{ github.sha }}/testing/output/ + - name: Artifact Test Output (opengles) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-opengles - name: Stop xvfb and openbox # should always stop xvfb and openbox even if other steps failed if: always() @@ -249,14 +265,17 @@ jobs: with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg path: pdb/Release/*.pdb + # install mesa for graphic tests - name: Install Mesa run: | curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z 7z x mesa.7z -o* powershell.exe mesa\systemwidedeploy.cmd 1 + # build love to use for the tests - name: Build Test Exe if: steps.vars.outputs.arch != 'ARM64' run: cmake --build build --config Release --target install + # windows opengl tests - name: Run Tests (opengl) if: steps.vars.outputs.arch != 'ARM64' run: | @@ -273,13 +292,36 @@ jobs: - name: Zip Test Output (opengl) if: steps.vars.outputs.arch != 'ARM64' run: | - 7z a -tzip test-output-windows-opengl.zip output\ + 7z a -tzip test-output-windows-opengl.zip megasource/libs/love/testing/output/ - name: Artifact Test Output (opengl) if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 with: name: test-output-windows-opengl path: test-output-windows-opengl.zip + # windows opengles tests + - name: Run Tests (opengles) + if: steps.vars.outputs.arch != 'ARM64' + run: | + $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 + powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua + - name: Love Test Report (opengles) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows (opengles) + title: test-report-windows-opengles + path: megasource/libs/love/testing/output/lovetest_runAllTests.md + - name: Zip Test Output (opengles) + if: steps.vars.outputs.arch != 'ARM64' + run: | + 7z a -tzip test-output-windows-opengles.zip megasource/libs/love/testing/output/ + - name: Artifact Test Output (opengles) + if: steps.vars.outputs.arch != 'ARM64' + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-opengles + path: test-output-windows-opengles.zip macOS: runs-on: macos-latest steps: @@ -308,6 +350,7 @@ jobs: with: name: love-macos path: love-macos.zip + # macos opengl tests (metal not supported on runners) - name: Run Test Suite run: | ls @@ -320,7 +363,7 @@ jobs: path: testing/output/lovetest_runAllTests.md - name: Zip Test Output run: | - 7z a -tzip test-output-macos-opengl.zip output/ + 7z a -tzip test-output-macos-opengl.zip ./testing/output/ - name: Artifact Test Output uses: actions/upload-artifact@v3 with: From 38ef55ee32430c2ed4af41458d28b1dfc9aa1cf3 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:38:35 +0000 Subject: [PATCH 29/54] add arch+compat to win test output --- .github/workflows/main.yml | 78 +++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e6285c0e..e3e65f063 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: linux-os: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: ALSOFT_CONF: resources/alsoft.conf DISPLAY: :99 @@ -19,7 +19,8 @@ jobs: libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ - libcurl4-openssl-dev libfuse2 wmctrl openbox + libcurl4-openssl-dev libfuse2 wmctrl openbox mesa-vulkan-drivers \ + libvulkan1 vulkan-tools vulkan-validationlayers - name: Checkout love-appimage-source uses: actions/checkout@v3 with: @@ -71,6 +72,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-output-linux-opengl + path: test-output-linux-opengl.zip # linux opengles tests - name: Run Test Suite (opengles) run: | @@ -89,6 +91,26 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-output-linux-opengles + path: test-output-linux-opengles.zip + # linux vulkan tests + - name: Run Test Suite (vulkan) + run: | + export LOVE_GRAPHICS_DEBUG=1 + ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --renderers vulkan + - name: Love Test Report (vulkan) + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Linux + title: test-report-linux-vulkan + path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md + - name: Zip Test Output (vulkan) + run: | + 7z a -tzip test-output-linux-vulkan.zip love2d-${{ github.sha }}/testing/output/ + - name: Artifact Test Output (vulkan) + uses: actions/upload-artifact@v3 + with: + name: test-output-linux-vulkan + path: test-output-linux-vulkan.zip - name: Stop xvfb and openbox # should always stop xvfb and openbox even if other steps failed if: always() @@ -286,8 +308,8 @@ jobs: if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: - name: Love Testsuite Windows (opengl) - title: test-report-windows-opengl + name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengl) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl path: megasource/libs/love/testing/output/lovetest_runAllTests.md - name: Zip Test Output (opengl) if: steps.vars.outputs.arch != 'ARM64' @@ -297,8 +319,8 @@ jobs: if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 with: - name: test-output-windows-opengl - path: test-output-windows-opengl.zip + name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl + path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl.zip # windows opengles tests - name: Run Tests (opengles) if: steps.vars.outputs.arch != 'ARM64' @@ -309,8 +331,8 @@ jobs: if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main with: - name: Love Testsuite Windows (opengles) - title: test-report-windows-opengles + name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengles) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles path: megasource/libs/love/testing/output/lovetest_runAllTests.md - name: Zip Test Output (opengles) if: steps.vars.outputs.arch != 'ARM64' @@ -320,8 +342,44 @@ jobs: if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 with: - name: test-output-windows-opengles - path: test-output-windows-opengles.zip + name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles + path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip + # install vulkan + - name: Install Vulkan + if: steps.vars.outputs.arch != 'ARM64' + run: | + curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe + ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma + curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip + 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" + copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" + reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 + powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary + # windows vulkan tests + - name: Run Tests (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + run: | + $ENV:LOVE_GRAPHICS_DEBUG=1 + powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --renderers vulkan + - name: Love Test Report (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + uses: ellraiser/love-test-report@main + with: + name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (vulkan) + title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan + path: megasource/libs/love/testing/output/lovetest_runAllTests.md + - name: Zip Test Output (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + run: | + 7z a -tzip test-output-windows-vulkan.zip megasource/libs/love/testing/output/ + - name: Artifact Test Output (vulkan) + if: steps.vars.outputs.arch != 'ARM64' + uses: actions/upload-artifact@v3 + with: + name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan + path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip macOS: runs-on: macos-latest steps: From 46d45678af64f53044918ca32ae1128f6c71055b Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:42:04 +0000 Subject: [PATCH 30/54] invalid lib linux --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3e65f063..66b25cf3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \ libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ - libcurl4-openssl-dev libfuse2 wmctrl openbox mesa-vulkan-drivers \ + libcurl4-openssl-dev libfuse2 wmctrl openbox mesa-vulkan-drivers \ libvulkan1 vulkan-tools vulkan-validationlayers - name: Checkout love-appimage-source uses: actions/checkout@v3 From b1fe623358ead2056e8baa09bd2c1b02793ae10d Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:53:42 +0000 Subject: [PATCH 31/54] turn off vulkan tests for now --- .github/workflows/main.yml | 110 ++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66b25cf3f..d73431727 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,25 +92,25 @@ jobs: with: name: test-output-linux-opengles path: test-output-linux-opengles.zip - # linux vulkan tests - - name: Run Test Suite (vulkan) - run: | - export LOVE_GRAPHICS_DEBUG=1 - ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --renderers vulkan - - name: Love Test Report (vulkan) - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Linux - title: test-report-linux-vulkan - path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md - - name: Zip Test Output (vulkan) - run: | - 7z a -tzip test-output-linux-vulkan.zip love2d-${{ github.sha }}/testing/output/ - - name: Artifact Test Output (vulkan) - uses: actions/upload-artifact@v3 - with: - name: test-output-linux-vulkan - path: test-output-linux-vulkan.zip +# # linux vulkan tests +# - name: Run Test Suite (vulkan) +# run: | +# export LOVE_GRAPHICS_DEBUG=1 +# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --renderers vulkan +# - name: Love Test Report (vulkan) +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Linux +# title: test-report-linux-vulkan +# path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md +# - name: Zip Test Output (vulkan) +# run: | +# 7z a -tzip test-output-linux-vulkan.zip love2d-${{ github.sha }}/testing/output/ +# - name: Artifact Test Output (vulkan) +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-linux-vulkan +# path: test-output-linux-vulkan.zip - name: Stop xvfb and openbox # should always stop xvfb and openbox even if other steps failed if: always() @@ -344,42 +344,42 @@ jobs: with: name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip - # install vulkan - - name: Install Vulkan - if: steps.vars.outputs.arch != 'ARM64' - run: | - curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe - ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma - curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip - 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" - copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" - reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 - powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary - # windows vulkan tests - - name: Run Tests (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - run: | - $ENV:LOVE_GRAPHICS_DEBUG=1 - powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --renderers vulkan - - name: Love Test Report (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - uses: ellraiser/love-test-report@main - with: - name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (vulkan) - title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan - path: megasource/libs/love/testing/output/lovetest_runAllTests.md - - name: Zip Test Output (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - run: | - 7z a -tzip test-output-windows-vulkan.zip megasource/libs/love/testing/output/ - - name: Artifact Test Output (vulkan) - if: steps.vars.outputs.arch != 'ARM64' - uses: actions/upload-artifact@v3 - with: - name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan - path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip +# # install vulkan +# - name: Install Vulkan +# if: steps.vars.outputs.arch != 'ARM64' +# run: | +# curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe +# ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma +# curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip +# 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64 +# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64" +# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32" +# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64" +# reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0 +# powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary +# # windows vulkan tests +# - name: Run Tests (vulkan) +# if: steps.vars.outputs.arch != 'ARM64' +# run: | +# $ENV:LOVE_GRAPHICS_DEBUG=1 +# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --renderers vulkan +# - name: Love Test Report (vulkan) +# if: steps.vars.outputs.arch != 'ARM64' +# uses: ellraiser/love-test-report@main +# with: +# name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (vulkan) +# title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan +# path: megasource/libs/love/testing/output/lovetest_runAllTests.md +# - name: Zip Test Output (vulkan) +# if: steps.vars.outputs.arch != 'ARM64' +# run: | +# 7z a -tzip test-output-windows-vulkan.zip megasource/libs/love/testing/output/ +# - name: Artifact Test Output (vulkan) +# if: steps.vars.outputs.arch != 'ARM64' +# uses: actions/upload-artifact@v3 +# with: +# name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan +# path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip macOS: runs-on: macos-latest steps: From 333169eb0f07e712c58c395e09d7711085785e47 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 21:22:10 +0000 Subject: [PATCH 32/54] fix alsoft path --- .github/workflows/main.yml | 10 +++++----- testing/tests/video.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d73431727..2bd4ed7a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ jobs: linux-os: runs-on: ubuntu-22.04 env: - ALSOFT_CONF: resources/alsoft.conf + ALSOFT_CONF: testing/resources/alsoft.conf DISPLAY: :99 steps: - name: Update APT @@ -130,7 +130,7 @@ jobs: windows-os: runs-on: windows-latest env: - ALSOFT_CONF: resources/alsoft.conf + ALSOFT_CONF: testing/resources/alsoft.conf VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json VULKAN_SDK: C:/VulkanSDK/1.3.231.1 strategy: @@ -314,7 +314,7 @@ jobs: - name: Zip Test Output (opengl) if: steps.vars.outputs.arch != 'ARM64' run: | - 7z a -tzip test-output-windows-opengl.zip megasource/libs/love/testing/output/ + 7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl.zip megasource/libs/love/testing/output/ - name: Artifact Test Output (opengl) if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 @@ -337,7 +337,7 @@ jobs: - name: Zip Test Output (opengles) if: steps.vars.outputs.arch != 'ARM64' run: | - 7z a -tzip test-output-windows-opengles.zip megasource/libs/love/testing/output/ + 7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip megasource/libs/love/testing/output/ - name: Artifact Test Output (opengles) if: steps.vars.outputs.arch != 'ARM64' uses: actions/upload-artifact@v3 @@ -373,7 +373,7 @@ jobs: # - name: Zip Test Output (vulkan) # if: steps.vars.outputs.arch != 'ARM64' # run: | -# 7z a -tzip test-output-windows-vulkan.zip megasource/libs/love/testing/output/ +# 7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip megasource/libs/love/testing/output/ # - name: Artifact Test Output (vulkan) # if: steps.vars.outputs.arch != 'ARM64' # uses: actions/upload-artifact@v3 diff --git a/testing/tests/video.lua b/testing/tests/video.lua index 06b4eea7c..42879712d 100644 --- a/testing/tests/video.lua +++ b/testing/tests/video.lua @@ -20,7 +20,7 @@ love.test.video.VideoStream = function(test) video:play() test:assertEquals(true, video:isPlaying(), 'check now playing') video:seek(0.3) - test:assertEquals(0.3, video:tell(), 'check seek/tell') + test:assertEquals(3, math.floor(video:tell()*10), 'check seek/tell') video:rewind() test:assertEquals(0, video:tell(), 'check rewind') video:pause() From c89e7930ba30c8ad4213fd55108393f5a85b6eff Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 21:33:11 +0000 Subject: [PATCH 33/54] alsoft relative to checkout --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2bd4ed7a4..78891f95e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ jobs: linux-os: runs-on: ubuntu-22.04 env: - ALSOFT_CONF: testing/resources/alsoft.conf + ALSOFT_CONF: love2d-${{ github.sha }}/testing/resources/alsoft.conf DISPLAY: :99 steps: - name: Update APT @@ -130,7 +130,7 @@ jobs: windows-os: runs-on: windows-latest env: - ALSOFT_CONF: testing/resources/alsoft.conf + ALSOFT_CONF: megasource/libs/love/testing/resources/alsoft.conf VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json VULKAN_SDK: C:/VulkanSDK/1.3.231.1 strategy: From 357b005e5332d7fca847a40eac5b1d263e6e7398 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:21:28 +0000 Subject: [PATCH 34/54] fix test.audio.Source --- testing/tests/audio.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/tests/audio.lua b/testing/tests/audio.lua index 436d5b6e7..464562943 100644 --- a/testing/tests/audio.lua +++ b/testing/tests/audio.lua @@ -144,14 +144,14 @@ love.test.audio.Source = function(test) type = 'flanger', volume = 10 }) - local seteffect, err = effsource:setEffect('flanger', { + local seteffect, err = effsource:setEffect('testeffect', { type = 'highpass', volume = 0.3, lowgain = 0.1 }) -- both these fail on 12 using stereo or mono, no err test:assertEquals(true, seteffect, 'check effect was applied') - local filtersettings = effsource:getEffect('chorus', {}) + local filtersettings = effsource:getEffect('effectthatdoesntexist', {}) test:assertNotNil(filtersettings) end From af4c50a4ceeea5b3cff0f371853e3bc4e8992ad0 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:06:16 +0000 Subject: [PATCH 35/54] skip test.audio.RecordingDevice on CI --- .github/workflows/main.yml | 14 +++++++------- testing/tests/audio.lua | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78891f95e..098ef32e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,7 @@ jobs: - name: Run Test Suite (opengl) run: | chmod a+x love-${{ github.sha }}.AppImage - ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua + ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner - name: Love Test Report (opengl) uses: ellraiser/love-test-report@main with: @@ -77,7 +77,7 @@ jobs: - name: Run Test Suite (opengles) run: | export LOVE_GRAPHICS_USE_OPENGLES=1 - ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua + ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner - name: Love Test Report (opengles) uses: ellraiser/love-test-report@main with: @@ -96,7 +96,7 @@ jobs: # - name: Run Test Suite (vulkan) # run: | # export LOVE_GRAPHICS_DEBUG=1 -# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --renderers vulkan +# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner --renderers vulkan # - name: Love Test Report (vulkan) # uses: ellraiser/love-test-report@main # with: @@ -303,7 +303,7 @@ jobs: run: | echo 'check dir' ls - powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua + powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner - name: Love Test Report (opengl) if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main @@ -326,7 +326,7 @@ jobs: if: steps.vars.outputs.arch != 'ARM64' run: | $ENV:LOVE_GRAPHICS_USE_OPENGLES=1 - powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua + powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner - name: Love Test Report (opengles) if: steps.vars.outputs.arch != 'ARM64' uses: ellraiser/love-test-report@main @@ -362,7 +362,7 @@ jobs: # if: steps.vars.outputs.arch != 'ARM64' # run: | # $ENV:LOVE_GRAPHICS_DEBUG=1 -# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --renderers vulkan +# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner --renderers vulkan # - name: Love Test Report (vulkan) # if: steps.vars.outputs.arch != 'ARM64' # uses: ellraiser/love-test-report@main @@ -412,7 +412,7 @@ jobs: - name: Run Test Suite run: | ls - love-macos/love.app/Contents/MacOS/love ./testing/main.lua + love-macos/love.app/Contents/MacOS/love ./testing/main.lua --runAllTests --isRunner - name: Love Test Report uses: ellraiser/love-test-report@main with: diff --git a/testing/tests/audio.lua b/testing/tests/audio.lua index 464562943..bf36b1187 100644 --- a/testing/tests/audio.lua +++ b/testing/tests/audio.lua @@ -10,6 +10,9 @@ -- RecordingDevice (love.audio.getRecordingDevices) love.test.audio.RecordingDevice = function(test) + if GITHUB_RUNNER == true then + return test:skipTest('cant emulate recording devices in CI') + end -- check devices first local devices = love.audio.getRecordingDevices() if #devices == 0 then From ad44eb4fd7a654a043ea6acfb98b2333d1a7a000 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:32:39 +0000 Subject: [PATCH 36/54] more graphics class tests - added graphics.Canvas, graphics.Font, graphics.Image, graphics.Quad, graphics.Shader and graphics.Text - removed rogue resource img - removed event wait test placeholder - updated todo list --- testing/examples/lovetest_runAllTests.html | 2 +- testing/examples/lovetest_runAllTests.md | 40 +- testing/examples/lovetest_runAllTests.xml | 572 +++++++++--------- .../expected/love.test.graphics.Font-1.png | Bin 0 -> 102 bytes .../expected/love.test.graphics.Font-2.png | Bin 0 -> 104 bytes .../expected/love.test.graphics.Image-1.png | Bin 0 -> 375 bytes .../expected/love.test.graphics.Quad-1.png | Bin 0 -> 265 bytes .../expected/love.test.graphics.Shader-1.png | Bin 0 -> 114 bytes .../expected/love.test.graphics.Text-1.png | Bin 0 -> 449 bytes .../love.test.graphics.setColorMask-1.png | Bin 99 -> 84 bytes testing/readme.md | 30 +- testing/resources/font-letters-ab.png | Bin 0 -> 146 bytes testing/resources/font-letters-cd.png | Bin 0 -> 146 bytes .../love_test_graphics_rectangle_expected.png | Bin 135 -> 0 bytes testing/tests/event.lua | 2 +- testing/tests/graphics.lua | 359 ++++++++++- 16 files changed, 646 insertions(+), 359 deletions(-) create mode 100644 testing/output/expected/love.test.graphics.Font-1.png create mode 100644 testing/output/expected/love.test.graphics.Font-2.png create mode 100644 testing/output/expected/love.test.graphics.Image-1.png create mode 100644 testing/output/expected/love.test.graphics.Quad-1.png create mode 100644 testing/output/expected/love.test.graphics.Shader-1.png create mode 100644 testing/output/expected/love.test.graphics.Text-1.png create mode 100644 testing/resources/font-letters-ab.png create mode 100644 testing/resources/font-letters-cd.png delete mode 100644 testing/resources/love_test_graphics_rectangle_expected.png diff --git a/testing/examples/lovetest_runAllTests.html b/testing/examples/lovetest_runAllTests.html index 5a0be8304..41462203f 100644 --- a/testing/examples/lovetest_runAllTests.html +++ b/testing/examples/lovetest_runAllTests.html @@ -1 +1 @@ -

🔴 love.test

  • 🟢 275 Tests
  • 🔴 2 Failures
  • 🟡 28 Skipped
  • 16.781s


🔴 love.audio

  • 🟢 27 Tests
  • 🔴 1 Failures
  • 🟡 0 Skipped
  • 4.898s


    • MethodTimeDetails
      🟢RecordingDevice4.419s
      🔴Source0.019sassert 53 [check effect was applied] expected 'true' got 'false'
      🟢getActiveEffects0.013s
      🟢getActiveSourceCount0.018s
      🟢getDistanceModel0.018s
      🟢getDopplerScale0.019s
      🟢getEffect0.018s
      🟢getMaxSceneEffects0.017s
      🟢getMaxSourceEffects0.016s
      🟢getOrientation0.018s
      🟢getPosition0.017s
      🟢getRecordingDevices0.017s
      🟢getVelocity0.018s
      🟢getVolume0.018s
      🟢isEffectsSupported0.017s
      🟢newQueueableSource0.016s
      🟢newSource0.019s
      🟢pause0.019s
      🟢play0.019s
      🟢setDistanceModel0.019s
      🟢setDopplerScale0.018s
      🟢setEffect0.017s
      🟢setMixWithSystem0.017s
      🟢setOrientation0.019s
      🟢setPosition0.019s
      🟢setVelocity0.018s
      🟢setVolume0.017s
      🟢stop0.019s

      🟢 love.data

      • 🟢 12 Tests
      • 🔴 0 Failures
      • 🟡 0 Skipped
      • 0.213s


        • MethodTimeDetails
          🟢ByteData0.017s
          🟢CompressedData0.017s
          🟢compress0.018s
          🟢decode0.018s
          🟢decompress0.018s
          🟢encode0.018s
          🟢getPackedSize0.018s
          🟢hash0.019s
          🟢newByteData0.017s
          🟢newDataView0.017s
          🟢pack0.017s
          🟢unpack0.018s

          🟢 love.event

          • 🟢 4 Tests
          • 🔴 0 Failures
          • 🟡 2 Skipped
          • 0.103s


            • MethodTimeDetails
              🟢clear0.015s
              🟢poll0.017s
              🟡pump0.018sused internally
              🟢push0.018s
              🟢quit0.018s
              🟡wait0.017stest class needs writing

              🟢 love.filesystem

              • 🟢 29 Tests
              • 🔴 0 Failures
              • 🟡 2 Skipped
              • 0.561s


                • MethodTimeDetails
                  🟢File0.018s
                  🟢FileData0.019s
                  🟢append0.020s
                  🟢areSymlinksEnabled0.017s
                  🟢createDirectory0.019s
                  🟢getAppdataDirectory0.018s
                  🟢getCRequirePath0.017s
                  🟢getDirectoryItems0.018s
                  🟢getIdentity0.018s
                  🟢getInfo0.019s
                  🟢getRealDirectory0.018s
                  🟢getRequirePath0.017s
                  🟢getSaveDirectory0.017s
                  🟡getSource0.016sused internally
                  🟢getSourceBaseDirectory0.018s
                  🟢getUserDirectory0.017s
                  🟢getWorkingDirectory0.018s
                  🟢isFused0.018s
                  🟢lines0.022s
                  🟢load0.017s
                  🟢mount0.018s
                  🟢newFileData0.018s
                  🟢openFile0.018s
                  🟢read0.018s
                  🟢remove0.018s
                  🟢setCRequirePath0.018s
                  🟢setIdentity0.019s
                  🟢setRequirePath0.019s
                  🟡setSource0.017sused internally
                  🟢unmount0.018s
                  🟢write0.019s

                  🔴 love.font

                  • 🟢 6 Tests
                  • 🔴 1 Failures
                  • 🟡 0 Skipped
                  • 0.123s


                    • MethodTimeDetails
                      🔴GlyphData0.017sassert 8 [check glyph number] expected '97' got '0'
                      🟢Rasterizer0.018s
                      🟢newBMFontRasterizer0.018s
                      🟢newGlyphData0.018s
                      🟢newImageRasterizer0.018s
                      🟢newRasterizer0.017s
                      🟢newTrueTypeRasterizer0.019s

                      🟢 love.graphics

                      • 🟢 93 Tests
                      • 🔴 0 Failures
                      • 🟡 14 Skipped
                      • 2.106s


                        • MethodTimeDetails
                          🟡Canvas0.017stest class needs writing
                          🟡Font0.018stest class needs writing
                          🟡Image0.017stest class needs writing
                          🟡Mesh0.017stest class needs writing
                          🟡ParticleSystem0.017stest class needs writing
                          🟡Quad0.017stest class needs writing
                          🟡Shader0.018stest class needs writing
                          🟡SpriteBatch0.018stest class needs writing
                          🟡Text0.018stest class needs writing
                          🟡Texture0.018stest class needs writing
                          🟡Video0.007stest class needs writing
                          🟢applyTransform0.019s

                          Expected

                          Actual

                          🟢arc0.024s

                          Expected

                          Actual

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢captureScreenshot0.184s
                          🟢circle0.021s

                          Expected

                          Actual

                          🟢clear0.018s

                          Expected

                          Actual

                          🟡discard0.016scant test this worked
                          🟢draw0.018s

                          Expected

                          Actual

                          🟡drawInstanced0.018stest class needs writing
                          🟢drawLayer0.020s

                          Expected

                          Actual

                          🟢ellipse0.018s

                          Expected

                          Actual

                          🟢flushBatch0.017s
                          🟢getBackgroundColor0.018s
                          🟢getBlendMode0.018s
                          🟢getCanvas0.019s
                          🟢getColor0.017s
                          🟢getColorMask0.018s
                          🟢getDPIScale0.017s
                          🟢getDefaultFilter0.018s
                          🟢getDepthMode0.017s
                          🟢getDimensions0.018s
                          🟢getFont0.019s
                          🟢getFrontFaceWinding0.017s
                          🟢getHeight0.017s
                          🟢getLineJoin0.017s
                          🟢getLineStyle0.020s
                          🟢getLineWidth0.016s
                          🟢getMeshCullMode0.016s
                          🟢getPixelDimensions0.018s
                          🟢getPixelHeight0.018s
                          🟢getPixelWidth0.018s
                          🟢getPointSize0.016s
                          🟢getRendererInfo0.019s
                          🟢getScissor0.017s
                          🟢getShader0.019s
                          🟢getStackDepth0.018s
                          🟢getStats0.018s
                          🟢getStencilMode0.017s
                          🟢getSupported0.018s
                          🟢getSystemLimits0.018s
                          🟢getTextureFormats0.019s
                          🟢getTextureTypes0.018s
                          🟢getWidth0.017s
                          🟢intersectScissor0.019s

                          Expected

                          Actual

                          🟢inverseTransformPoint0.017s
                          🟢isActive0.017s
                          🟢isGammaCorrect0.018s
                          🟢isWireframe0.018s
                          🟢line0.019s

                          Expected

                          Actual

                          🟢newArrayImage0.019s
                          🟢newCanvas0.015s
                          🟢newCubeImage0.020s
                          🟢newFont0.018s
                          🟢newImage0.017s
                          🟢newImageFont0.019s
                          🟢newMesh0.018s
                          🟢newParticleSystem0.018s
                          🟢newQuad0.017s
                          🟢newShader0.022s
                          🟢newSpriteBatch0.019s
                          🟢newTextBatch0.016s
                          🟢newVideo0.021s
                          🟢newVolumeImage0.019s
                          🟢origin0.018s

                          Expected

                          Actual

                          🟢points0.019s

                          Expected

                          Actual

                          🟢polygon0.016s

                          Expected

                          Actual

                          🟢pop0.019s

                          Expected

                          Actual

                          🟡present0.018stest class needs writing
                          🟢print0.019s

                          Expected

                          Actual

                          🟢printf0.019s

                          Expected

                          Actual

                          🟢push0.021s

                          Expected

                          Actual

                          🟢rectangle0.018s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢replaceTransform0.017s

                          Expected

                          Actual

                          🟢reset0.017s
                          🟢rotate0.020s

                          Expected

                          Actual

                          🟢scale0.020s
                          🟢setBackgroundColor0.017s
                          🟢setBlendMode0.020s

                          Expected

                          Actual

                          🟢setCanvas0.019s

                          Expected

                          Actual

                          🟢setColor0.018s

                          Expected

                          Actual

                          🟢setColorMask0.019s

                          Expected

                          Actual

                          🟢setDefaultFilter0.018s
                          🟢setDepthMode0.018s
                          🟢setFont0.018s

                          Expected

                          Actual

                          🟢setFrontFaceWinding0.018s
                          🟢setLineJoin0.020s

                          Expected

                          Actual

                          🟢setLineStyle0.017s

                          Expected

                          Actual

                          🟢setLineWidth0.018s

                          Expected

                          Actual

                          🟢setMeshCullMode0.018s
                          🟢setScissor0.018s

                          Expected

                          Actual

                          🟢setShader0.024s

                          Expected

                          Actual

                          🟢setStencilTest0.018s

                          Expected

                          Actual

                          🟢setWireframe0.019s

                          Expected

                          Actual

                          🟢shear0.021s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢transformPoint0.016s
                          🟢translate0.020s

                          Expected

                          Actual

                          🟢validateShader0.021s

                          🟢 love.image

                          • 🟢 5 Tests
                          • 🔴 0 Failures
                          • 🟡 0 Skipped
                          • 0.088s


                            • MethodTimeDetails
                              🟢CompressedImageData0.018s
                              🟢ImageData0.018s
                              🟢isCompressed0.017s
                              🟢newCompressedData0.018s
                              🟢newImageData0.018s

                              🟢 love.math

                              • 🟢 20 Tests
                              • 🔴 0 Failures
                              • 🟡 0 Skipped
                              • 0.284s


                                • MethodTimeDetails
                                  🟢BezierCurve0.016s
                                  🟢RandomGenerator0.017s
                                  🟢Transform0.017s
                                  🟢colorFromBytes0.018s
                                  🟢colorToBytes0.018s
                                  🟢gammaToLinear0.017s
                                  🟢getRandomSeed0.017s
                                  🟢getRandomState0.018s
                                  🟢isConvex0.018s
                                  🟢linearToGamma0.018s
                                  🟢newBezierCurve0.018s
                                  🟢newRandomGenerator0.018s
                                  🟢newTransform0.017s
                                  🟢perlinNoise0.019s
                                  🟢random0.012s
                                  🟢randomNormal0.017s
                                  🟢setRandomSeed0.002s
                                  🟢setRandomState0.002s
                                  🟢simplexNoise0.002s
                                  🟢triangulate0.003s

                                  🟢 love.physics

                                  • 🟢 22 Tests
                                  • 🔴 0 Failures
                                  • 🟡 6 Skipped
                                  • 0.059s


                                    • MethodTimeDetails
                                      🟡Body0.002stest class needs writing
                                      🟡Contact0.002stest class needs writing
                                      🟡Fixture0.002stest class needs writing
                                      🟡Joint0.002stest class needs writing
                                      🟡Shape0.002stest class needs writing
                                      🟡World0.002stest class needs writing
                                      🟢getDistance0.002s
                                      🟢getMeter0.002s
                                      🟢newBody0.002s
                                      🟢newChainShape0.002s
                                      🟢newCircleShape0.005s
                                      🟢newDistanceJoint0.002s
                                      🟢newEdgeShape0.002s
                                      🟢newFixture0.002s
                                      🟢newFrictionJoint0.002s
                                      🟢newGearJoint0.002s
                                      🟢newMotorJoint0.002s
                                      🟢newMouseJoint0.002s
                                      🟢newPolygonShape0.002s
                                      🟢newPrismaticJoint0.002s
                                      🟢newPulleyJoint0.002s
                                      🟢newRectangleShape0.002s
                                      🟢newRevoluteJoint0.002s
                                      🟢newRopeJoint0.002s
                                      🟢newWeldJoint0.002s
                                      🟢newWheelJoint0.002s
                                      🟢newWorld0.002s
                                      🟢setMeter0.002s

                                      🟢 love.sound

                                      • 🟢 4 Tests
                                      • 🔴 0 Failures
                                      • 🟡 0 Skipped
                                      • 0.015s


                                        • MethodTimeDetails
                                          🟢Decoder0.007s
                                          🟢SoundData0.003s
                                          🟢newDecoder0.002s
                                          🟢newSoundData0.003s

                                          🟢 love.system

                                          • 🟢 6 Tests
                                          • 🔴 0 Failures
                                          • 🟡 2 Skipped
                                          • 0.023s


                                            • MethodTimeDetails
                                              🟢getClipboardText0.004s
                                              🟢getOS0.007s
                                              🟢getPowerInfo0.002s
                                              🟢getProcessorCount0.002s
                                              🟢hasBackgroundMusic0.002s
                                              🟡openURL0.002scant test this worked
                                              🟢setClipboardText0.003s
                                              🟡vibrate0.002scant test this worked

                                              🟢 love.thread

                                              • 🟢 5 Tests
                                              • 🔴 0 Failures
                                              • 🟡 0 Skipped
                                              • 0.318s


                                                • MethodTimeDetails
                                                  🟢Channel0.220s
                                                  🟢Thread0.092s
                                                  🟢getChannel0.002s
                                                  🟢newChannel0.002s
                                                  🟢newThread0.002s

                                                  🟢 love.timer

                                                  • 🟢 6 Tests
                                                  • 🔴 0 Failures
                                                  • 🟡 0 Skipped
                                                  • 2.020s


                                                    • MethodTimeDetails
                                                      🟢getAverageDelta0.002s
                                                      🟢getDelta0.002s
                                                      🟢getFPS0.002s
                                                      🟢getTime1.003s
                                                      🟢sleep1.006s
                                                      🟢step0.004s

                                                      🟢 love.video

                                                      • 🟢 2 Tests
                                                      • 🔴 0 Failures
                                                      • 🟡 0 Skipped
                                                      • 0.016s


                                                        • MethodTimeDetails
                                                          🟢VideoStream0.009s
                                                          🟢newVideoStream0.007s

                                                          🟢 love.window

                                                          • 🟢 34 Tests
                                                          • 🔴 0 Failures
                                                          • 🟡 2 Skipped
                                                          • 5.954s


                                                            • MethodTimeDetails
                                                              🟢close0.054s
                                                              🟢fromPixels0.002s
                                                              🟢getDPIScale0.002s
                                                              🟢getDesktopDimensions0.002s
                                                              🟢getDisplayCount0.002s
                                                              🟢getDisplayName0.015s
                                                              🟢getDisplayOrientation0.017s
                                                              🟢getFullscreen1.340s
                                                              🟢getFullscreenModes0.009s
                                                              🟢getIcon0.019s
                                                              🟢getMode0.014s
                                                              🟢getPosition0.017s
                                                              🟢getSafeArea0.017s
                                                              🟢getTitle0.018s
                                                              🟢getVSync0.017s
                                                              🟢hasFocus0.018s
                                                              🟢hasMouseFocus0.018s
                                                              🟢isDisplaySleepEnabled0.017s
                                                              🟢isMaximized0.186s
                                                              🟢isMinimized0.744s
                                                              🟢isOpen0.054s
                                                              🟢isVisible0.031s
                                                              🟢maximize0.173s
                                                              🟢minimize0.740s
                                                              🟡requestAttention0.003scant test this worked
                                                              🟢restore0.840s
                                                              🟢setDisplaySleepEnabled0.016s
                                                              🟢setFullscreen1.335s
                                                              🟢setIcon0.013s
                                                              🟢setMode0.021s
                                                              🟢setPosition0.178s
                                                              🟢setTitle0.003s
                                                              🟢setVSync0.002s
                                                              🟡showMessageBox0.002scant test this worked
                                                              🟢toPixels0.002s
                                                              🟢updateMode0.014s
\ No newline at end of file +

🔴 love.test

  • 🟢 281 Tests
  • 🔴 2 Failures
  • 🟡 20 Skipped
  • 13.278s


🟢 love.audio

  • 🟢 28 Tests
  • 🔴 0 Failures
  • 🟡 0 Skipped
  • 0.851s


    • MethodTimeDetails
      🟢RecordingDevice0.397s
      🟢Source0.021s
      🟢getActiveEffects0.017s
      🟢getActiveSourceCount0.018s
      🟢getDistanceModel0.017s
      🟢getDopplerScale0.017s
      🟢getEffect0.017s
      🟢getMaxSceneEffects0.017s
      🟢getMaxSourceEffects0.017s
      🟢getOrientation0.017s
      🟢getPosition0.016s
      🟢getRecordingDevices0.017s
      🟢getVelocity0.014s
      🟢getVolume0.017s
      🟢isEffectsSupported0.017s
      🟢newQueueableSource0.017s
      🟢newSource0.017s
      🟢pause0.017s
      🟢play0.017s
      🟢setDistanceModel0.018s
      🟢setDopplerScale0.016s
      🟢setEffect0.017s
      🟢setMixWithSystem0.017s
      🟢setOrientation0.016s
      🟢setPosition0.016s
      🟢setVelocity0.016s
      🟢setVolume0.016s
      🟢stop0.017s

      🟢 love.data

      • 🟢 12 Tests
      • 🔴 0 Failures
      • 🟡 0 Skipped
      • 0.197s


        • MethodTimeDetails
          🟢ByteData0.016s
          🟢CompressedData0.016s
          🟢compress0.016s
          🟢decode0.018s
          🟢decompress0.017s
          🟢encode0.017s
          🟢getPackedSize0.016s
          🟢hash0.015s
          🟢newByteData0.016s
          🟢newDataView0.015s
          🟢pack0.018s
          🟢unpack0.016s

          🟢 love.event

          • 🟢 4 Tests
          • 🔴 0 Failures
          • 🟡 2 Skipped
          • 0.096s


            • MethodTimeDetails
              🟢clear0.016s
              🟢poll0.016s
              🟡pump0.016sused internally
              🟢push0.016s
              🟢quit0.016s
              🟡wait0.016sused internally

              🟢 love.filesystem

              • 🟢 29 Tests
              • 🔴 0 Failures
              • 🟡 2 Skipped
              • 0.539s


                • MethodTimeDetails
                  🟢File0.020s
                  🟢FileData0.016s
                  🟢append0.022s
                  🟢areSymlinksEnabled0.017s
                  🟢createDirectory0.017s
                  🟢getAppdataDirectory0.016s
                  🟢getCRequirePath0.017s
                  🟢getDirectoryItems0.019s
                  🟢getIdentity0.017s
                  🟢getInfo0.018s
                  🟢getRealDirectory0.017s
                  🟢getRequirePath0.017s
                  🟢getSaveDirectory0.017s
                  🟡getSource0.017sused internally
                  🟢getSourceBaseDirectory0.017s
                  🟢getUserDirectory0.018s
                  🟢getWorkingDirectory0.021s
                  🟢isFused0.014s
                  🟢lines0.017s
                  🟢load0.018s
                  🟢mount0.018s
                  🟢newFileData0.018s
                  🟢openFile0.016s
                  🟢read0.016s
                  🟢remove0.017s
                  🟢setCRequirePath0.016s
                  🟢setIdentity0.016s
                  🟢setRequirePath0.015s
                  🟡setSource0.017sused internally
                  🟢unmount0.018s
                  🟢write0.019s

                  🔴 love.font

                  • 🟢 6 Tests
                  • 🔴 1 Failures
                  • 🟡 0 Skipped
                  • 0.121s


                    • MethodTimeDetails
                      🔴GlyphData0.016sassert 8 [check glyph number] expected '97' got '0'
                      🟢Rasterizer0.016s
                      🟢newBMFontRasterizer0.017s
                      🟢newGlyphData0.018s
                      🟢newImageRasterizer0.018s
                      🟢newRasterizer0.018s
                      🟢newTrueTypeRasterizer0.018s

                      🔴 love.graphics

                      • 🟢 98 Tests
                      • 🔴 1 Failures
                      • 🟡 6 Skipped
                      • 2.029s


                        • MethodTimeDetails
                          🔴Canvas0.018sassert 44 [check depth sample mode set] expected 'equal' got 'nil'
                          🟢Font0.023s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢Image0.020s

                          Expected

                          Actual

                          🟡Mesh0.018stest class needs writing
                          🟡ParticleSystem0.017stest class needs writing
                          🟢Quad0.020s

                          Expected

                          Actual

                          🟢Shader0.029s

                          Expected

                          Actual

                          🟡SpriteBatch0.016stest class needs writing
                          🟢Text0.014s

                          Expected

                          Actual

                          🟡Video0.015stest class needs writing
                          🟢applyTransform0.018s

                          Expected

                          Actual

                          🟢arc0.026s

                          Expected

                          Actual

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢captureScreenshot0.183s
                          🟢circle0.023s

                          Expected

                          Actual

                          🟢clear0.018s

                          Expected

                          Actual

                          🟡discard0.017scant test this worked
                          🟢draw0.034s

                          Expected

                          Actual

                          🟡drawInstanced0.014stest class needs writing
                          🟢drawLayer0.017s

                          Expected

                          Actual

                          🟢ellipse0.018s

                          Expected

                          Actual

                          🟢flushBatch0.016s
                          🟢getBackgroundColor0.016s
                          🟢getBlendMode0.016s
                          🟢getCanvas0.016s
                          🟢getColor0.016s
                          🟢getColorMask0.015s
                          🟢getDPIScale0.016s
                          🟢getDefaultFilter0.016s
                          🟢getDepthMode0.016s
                          🟢getDimensions0.016s
                          🟢getFont0.016s
                          🟢getFrontFaceWinding0.016s
                          🟢getHeight0.015s
                          🟢getLineJoin0.016s
                          🟢getLineStyle0.025s
                          🟢getLineWidth0.018s
                          🟢getMeshCullMode0.016s
                          🟢getPixelDimensions0.016s
                          🟢getPixelHeight0.024s
                          🟢getPixelWidth0.013s
                          🟢getPointSize0.016s
                          🟢getRendererInfo0.016s
                          🟢getScissor0.016s
                          🟢getShader0.017s
                          🟢getStackDepth0.016s
                          🟢getStats0.015s
                          🟢getStencilMode0.016s
                          🟢getSupported0.015s
                          🟢getSystemLimits0.015s
                          🟢getTextureFormats0.017s
                          🟢getTextureTypes0.016s
                          🟢getWidth0.015s
                          🟢intersectScissor0.017s

                          Expected

                          Actual

                          🟢inverseTransformPoint0.016s
                          🟢isActive0.016s
                          🟢isGammaCorrect0.015s
                          🟢isWireframe0.015s
                          🟢line0.017s

                          Expected

                          Actual

                          🟢newArrayImage0.016s
                          🟢newCanvas0.015s
                          🟢newCubeImage0.017s
                          🟢newFont0.017s
                          🟢newImage0.017s
                          🟢newImageFont0.016s
                          🟢newMesh0.016s
                          🟢newParticleSystem0.017s
                          🟢newQuad0.016s
                          🟢newShader0.022s
                          🟢newSpriteBatch0.017s
                          🟢newTextBatch0.011s
                          🟢newVideo0.019s
                          🟢newVolumeImage0.018s
                          🟢origin0.018s

                          Expected

                          Actual

                          🟢points0.020s

                          Expected

                          Actual

                          🟢polygon0.021s

                          Expected

                          Actual

                          🟢pop0.018s

                          Expected

                          Actual

                          🟢print0.020s

                          Expected

                          Actual

                          🟢printf0.020s

                          Expected

                          Actual

                          🟢push0.018s

                          Expected

                          Actual

                          🟢rectangle0.020s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢replaceTransform0.018s

                          Expected

                          Actual

                          🟢reset0.018s
                          🟢rotate0.018s

                          Expected

                          Actual

                          🟢scale0.017s
                          🟢setBackgroundColor0.017s
                          🟢setBlendMode0.019s

                          Expected

                          Actual

                          🟢setCanvas0.018s

                          Expected

                          Actual

                          🟢setColor0.018s

                          Expected

                          Actual

                          🟢setColorMask0.019s

                          Expected

                          Actual

                          🟢setDefaultFilter0.017s
                          🟢setDepthMode0.017s
                          🟢setFont0.019s

                          Expected

                          Actual

                          🟢setFrontFaceWinding0.017s
                          🟢setLineJoin0.018s

                          Expected

                          Actual

                          🟢setLineStyle0.018s

                          Expected

                          Actual

                          🟢setLineWidth0.019s

                          Expected

                          Actual

                          🟢setMeshCullMode0.018s
                          🟢setScissor0.020s

                          Expected

                          Actual

                          🟢setShader0.023s

                          Expected

                          Actual

                          🟢setStencilTest0.019s

                          Expected

                          Actual

                          🟢setWireframe0.018s

                          Expected

                          Actual

                          🟢shear0.019s

                          Expected

                          Actual

                          Expected

                          Actual

                          🟢transformPoint0.018s
                          🟢translate0.025s

                          Expected

                          Actual

                          🟢validateShader0.016s

                          🟢 love.image

                          • 🟢 5 Tests
                          • 🔴 0 Failures
                          • 🟡 0 Skipped
                          • 0.087s


                            • MethodTimeDetails
                              🟢CompressedImageData0.018s
                              🟢ImageData0.017s
                              🟢isCompressed0.017s
                              🟢newCompressedData0.019s
                              🟢newImageData0.017s

                              🟢 love.math

                              • 🟢 20 Tests
                              • 🔴 0 Failures
                              • 🟡 0 Skipped
                              • 0.321s


                                • MethodTimeDetails
                                  🟢BezierCurve0.018s
                                  🟢RandomGenerator0.017s
                                  🟢Transform0.017s
                                  🟢colorFromBytes0.017s
                                  🟢colorToBytes0.016s
                                  🟢gammaToLinear0.016s
                                  🟢getRandomSeed0.016s
                                  🟢getRandomState0.016s
                                  🟢isConvex0.016s
                                  🟢linearToGamma0.017s
                                  🟢newBezierCurve0.016s
                                  🟢newRandomGenerator0.016s
                                  🟢newTransform0.016s
                                  🟢perlinNoise0.015s
                                  🟢random0.016s
                                  🟢randomNormal0.014s
                                  🟢setRandomSeed0.015s
                                  🟢setRandomState0.015s
                                  🟢simplexNoise0.016s
                                  🟢triangulate0.016s

                                  🟢 love.physics

                                  • 🟢 22 Tests
                                  • 🔴 0 Failures
                                  • 🟡 6 Skipped
                                  • 0.468s


                                    • MethodTimeDetails
                                      🟡Body0.018stest class needs writing
                                      🟡Contact0.017stest class needs writing
                                      🟡Fixture0.026stest class needs writing
                                      🟡Joint0.017stest class needs writing
                                      🟡Shape0.017stest class needs writing
                                      🟡World0.017stest class needs writing
                                      🟢getDistance0.017s
                                      🟢getMeter0.015s
                                      🟢newBody0.016s
                                      🟢newChainShape0.016s
                                      🟢newCircleShape0.017s
                                      🟢newDistanceJoint0.016s
                                      🟢newEdgeShape0.017s
                                      🟢newFixture0.016s
                                      🟢newFrictionJoint0.016s
                                      🟢newGearJoint0.016s
                                      🟢newMotorJoint0.016s
                                      🟢newMouseJoint0.018s
                                      🟢newPolygonShape0.016s
                                      🟢newPrismaticJoint0.017s
                                      🟢newPulleyJoint0.016s
                                      🟢newRectangleShape0.017s
                                      🟢newRevoluteJoint0.015s
                                      🟢newRopeJoint0.016s
                                      🟢newWeldJoint0.015s
                                      🟢newWheelJoint0.016s
                                      🟢newWorld0.014s
                                      🟢setMeter0.015s

                                      🟢 love.sound

                                      • 🟢 4 Tests
                                      • 🔴 0 Failures
                                      • 🟡 0 Skipped
                                      • 0.068s


                                        • MethodTimeDetails
                                          🟢Decoder0.018s
                                          🟢SoundData0.017s
                                          🟢newDecoder0.016s
                                          🟢newSoundData0.017s

                                          🟢 love.system

                                          • 🟢 6 Tests
                                          • 🔴 0 Failures
                                          • 🟡 2 Skipped
                                          • 0.148s


                                            • MethodTimeDetails
                                              🟢getClipboardText0.019s
                                              🟢getOS0.017s
                                              🟢getPowerInfo0.017s
                                              🟢getProcessorCount0.016s
                                              🟢hasBackgroundMusic0.029s
                                              🟡openURL0.016scant test this worked
                                              🟢setClipboardText0.017s
                                              🟡vibrate0.016scant test this worked

                                              🟢 love.thread

                                              • 🟢 5 Tests
                                              • 🔴 0 Failures
                                              • 🟡 0 Skipped
                                              • 0.376s


                                                • MethodTimeDetails
                                                  🟢Channel0.230s
                                                  🟢Thread0.093s
                                                  🟢getChannel0.018s
                                                  🟢newChannel0.017s
                                                  🟢newThread0.018s

                                                  🟢 love.timer

                                                  • 🟢 6 Tests
                                                  • 🔴 0 Failures
                                                  • 🟡 0 Skipped
                                                  • 2.082s


                                                    • MethodTimeDetails
                                                      🟢getAverageDelta0.017s
                                                      🟢getDelta0.016s
                                                      🟢getFPS0.016s
                                                      🟢getTime1.017s
                                                      🟢sleep1.009s
                                                      🟢step0.005s

                                                      🟢 love.video

                                                      • 🟢 2 Tests
                                                      • 🔴 0 Failures
                                                      • 🟡 0 Skipped
                                                      • 0.039s


                                                        • MethodTimeDetails
                                                          🟢VideoStream0.020s
                                                          🟢newVideoStream0.020s

                                                          🟢 love.window

                                                          • 🟢 34 Tests
                                                          • 🔴 0 Failures
                                                          • 🟡 2 Skipped
                                                          • 5.855s


                                                            • MethodTimeDetails
                                                              🟢close0.052s
                                                              🟢fromPixels0.002s
                                                              🟢getDPIScale0.017s
                                                              🟢getDesktopDimensions0.018s
                                                              🟢getDisplayCount0.017s
                                                              🟢getDisplayName0.018s
                                                              🟢getDisplayOrientation0.018s
                                                              🟢getFullscreen1.357s
                                                              🟢getFullscreenModes0.010s
                                                              🟢getIcon0.019s
                                                              🟢getMode0.015s
                                                              🟢getPosition0.017s
                                                              🟢getSafeArea0.016s
                                                              🟢getTitle0.017s
                                                              🟢getVSync0.016s
                                                              🟢hasFocus0.016s
                                                              🟢hasMouseFocus0.015s
                                                              🟢isDisplaySleepEnabled0.017s
                                                              🟢isMaximized0.185s
                                                              🟢isMinimized0.749s
                                                              🟢isOpen0.037s
                                                              🟢isVisible0.024s
                                                              🟢maximize0.156s
                                                              🟢minimize0.733s
                                                              🟡requestAttention0.003scant test this worked
                                                              🟢restore0.880s
                                                              🟢setDisplaySleepEnabled0.020s
                                                              🟢setFullscreen1.151s
                                                              🟢setIcon0.007s
                                                              🟢setMode0.023s
                                                              🟢setPosition0.181s
                                                              🟢setTitle0.018s
                                                              🟢setVSync0.015s
                                                              🟡showMessageBox0.003scant test this worked
                                                              🟢toPixels0.002s
                                                              🟢updateMode0.011s
\ No newline at end of file diff --git a/testing/examples/lovetest_runAllTests.md b/testing/examples/lovetest_runAllTests.md index c69865ba7..d309282ee 100644 --- a/testing/examples/lovetest_runAllTests.md +++ b/testing/examples/lovetest_runAllTests.md @@ -1,31 +1,31 @@ - + -**305** tests were completed in **16.781s** with **275** passed, **2** failed, and **28** skipped +**303** tests were completed in **13.278s** with **281** passed, **2** failed, and **20** skipped ### Report | Module | Pass | Fail | Skip | Time | | --------------------- | ------ | ------ | ------- | ------ | -| 🔴 audio | 27 | 1 | 0 | 4.898s | -| 🟢 data | 12 | 0 | 0 | 0.213s | -| 🟢 event | 4 | 0 | 2 | 0.103s | -| 🟢 filesystem | 29 | 0 | 2 | 0.561s | -| 🔴 font | 6 | 1 | 0 | 0.123s | -| 🟢 graphics | 93 | 0 | 14 | 2.106s | -| 🟢 image | 5 | 0 | 0 | 0.088s | -| 🟢 math | 20 | 0 | 0 | 0.284s | -| 🟢 physics | 22 | 0 | 6 | 0.059s | -| 🟢 sound | 4 | 0 | 0 | 0.015s | -| 🟢 system | 6 | 0 | 2 | 0.023s | -| 🟢 thread | 5 | 0 | 0 | 0.318s | -| 🟢 timer | 6 | 0 | 0 | 2.020s | -| 🟢 video | 2 | 0 | 0 | 0.016s | -| 🟢 window | 34 | 0 | 2 | 5.954s | +| 🟢 audio | 28 | 0 | 0 | 0.851s | +| 🟢 data | 12 | 0 | 0 | 0.197s | +| 🟢 event | 4 | 0 | 2 | 0.096s | +| 🟢 filesystem | 29 | 0 | 2 | 0.539s | +| 🔴 font | 6 | 1 | 0 | 0.121s | +| 🔴 graphics | 98 | 1 | 6 | 2.029s | +| 🟢 image | 5 | 0 | 0 | 0.087s | +| 🟢 math | 20 | 0 | 0 | 0.321s | +| 🟢 physics | 22 | 0 | 6 | 0.468s | +| 🟢 sound | 4 | 0 | 0 | 0.068s | +| 🟢 system | 6 | 0 | 2 | 0.148s | +| 🟢 thread | 5 | 0 | 0 | 0.376s | +| 🟢 timer | 6 | 0 | 0 | 2.082s | +| 🟢 video | 2 | 0 | 0 | 0.039s | +| 🟢 window | 34 | 0 | 2 | 5.855s | ### Failures -> 🔴 Source -> assert 53 [check effect was applied] expected 'true' got 'false' - > 🔴 GlyphData > assert 8 [check glyph number] expected '97' got '0' +> 🔴 Canvas +> assert 44 [check depth sample mode set] expected 'equal' got 'nil' + diff --git a/testing/examples/lovetest_runAllTests.xml b/testing/examples/lovetest_runAllTests.xml index deb2d4201..dc3bb5e04 100644 --- a/testing/examples/lovetest_runAllTests.xml +++ b/testing/examples/lovetest_runAllTests.xml @@ -1,162 +1,161 @@ - - - + + + - - assert 53 [check effect was applied] expected 'true' got 'false' + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -166,507 +165,496 @@ - - + + assert 8 [check glyph number] expected '97' got '0' - + - + - + - + - - - + + + assert 44 [check depth sample mode set] expected 'equal' got 'nil' - - + - - + - + - - - - - + - - + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/testing/output/expected/love.test.graphics.Font-1.png b/testing/output/expected/love.test.graphics.Font-1.png new file mode 100644 index 0000000000000000000000000000000000000000..cb2f21a1ed0ead98be5e0e43126476ea1846c3b6 GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx?BpA#)4xIr~OeH~n!3+##lh0ZJdGekvjv*Cu xk`ox3nb_L+*xJr9^Vo|>SjiidGlFz xshE?TkdUxpWnw`Q(?Tl==9Vmp2SI!sEDT3ZaCjzihCK&q@pScbS?83{1OW6x7uf&+ literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.Image-1.png b/testing/output/expected/love.test.graphics.Image-1.png new file mode 100644 index 0000000000000000000000000000000000000000..5f45cf9e74d822c536be3082099ce09133192c72 GIT binary patch literal 375 zcmV--0f_#IP)RqEy~ItC z5mFp&z>Rw^VUMCxV1~#Pw?z6h2RKS3iW2EG!Kvd%{6aY~=F{WOhX9~w3vkj;0O)6W zfS&`Q5u1WUTnZBDQ;-ONMl6MfI0|P?NCZG5mcynA0Ivxc!hsmD5j(&N6K+h*@pp{( z2|W{Qyw7o8FfbA0zQ%}%g&1Q#H_S*T^7+Gz^fCk@Rtk@dSRJt)HFOkw4POU>kv0<&MCde85J3Ad;$JONIJ VNX|>^XKVlf002ovPDHLkV1i~FlZyZV literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.Quad-1.png b/testing/output/expected/love.test.graphics.Quad-1.png new file mode 100644 index 0000000000000000000000000000000000000000..22ab17e3e15b1eaeb545971e015ac2e9d0edadc9 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0L3?#3!&-4XSJOMr-u0Z-)*!2JZ{|B$QGso=x z1R$TWB*-tA!Qt7BG$3cSr;B4q#hl)A2YHzk1>7FaKRm@Dvtk3w?~N?{)^gigma1?m zIEE!N=@(w#c~-na;jguu#|`F#91|xnG$yoocr-W|IH{;OC`c#@2_^XJD1SL}^?mW9 zXZ@BB_xW^o?^ZT+QdzRs(!qk&y7hfY^|ouL6xYapQp}NMSt0D>TPt@`c}=jBPY0)= z;vc75{5_nx9xD_-vN38c6fkmZ@X~1U5m+F^r6|0i+q~{PxAOiC+!_*D&Om1~c)I$z JtaD0e0su2hE&W+PDtS3O;u>(;Emnd#lgf->?i8DIiOG!q}9{a&t;uc GLK6UQNgGoD literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.Text-1.png b/testing/output/expected/love.test.graphics.Text-1.png new file mode 100644 index 0000000000000000000000000000000000000000..4f15348cdffb4bef7adb7f461cb7aa263898fb36 GIT binary patch literal 449 zcmV;y0Y3hTP)g0{U)fQ71UQFBI6Q;wZG z0*wS!;pL=IpSs;{IOUo^RDpGDJ>WW&G!tEuuW*)dYu8e#o>y4220Gs@6BTxa2;CWE zsj0ddWU@b_5YP-d&zwbjj6?ltXt+sh2AYAINT_*OG%8gGIxl3sBz?BPqzsZEqbcMN rM=@@|tfwsc>4+=zl2Go(@jvSeY+*#a?9lLD00000NkvXXu0mjf!hyg) literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setColorMask-1.png b/testing/output/expected/love.test.graphics.setColorMask-1.png index 254f834f807f381374e51f249e36e74ffcdd595f..315c7a936f3dc201ea118e957e50a50e5f26b1f7 100644 GIT binary patch delta 65 zcmYcenIK`q$jrdNplX||1f-Y)d_r9R|7Ykr_Qe&*Eak-(VP6||NMvc%&ZNaLT4AV h^+*|H9Y`=@U`U$HEPMFm^IbrN44$rjF6*2UngH~68iN1; diff --git a/testing/readme.md b/testing/readme.md index 2f6f8bb42..9a56fe471 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -23,10 +23,10 @@ This is the status of all module tests currently. | ----------------- | ---- | ---- | ---- | | 🟢 audio | 28 | 0 | 0 | | 🟢 data | 12 | 0 | 0 | -| 🟡 event | 4 | 1 | 1 | -| 🟢 filesystem | 28 | 0 | 2 | +| 🟢 event | 4 | 0 | 2 | +| 🟢 filesystem | 29 | 0 | 2 | | 🟢 font | 7 | 0 | 0 | -| 🟡 graphics | 93 | 14 | 1 | +| 🟡 graphics | 99 | 5 | 1 | | 🟢 image | 5 | 0 | 0 | | 🟢 math | 20 | 0 | 0 | | 🟡 physics | 22 | 6 | 0 | @@ -113,24 +113,20 @@ For sanity-checking, if it's currently not covered or it's not possible to test Things still left to do: - [ ] physics.Body, physics.Contact, physics.Fixture, physics.Joint, physics.Shape, physics.World -- [ ] graphics.Canvas, graphics.Font, graphics.Image, graphics.Mesh, - graphics.ParticleSystem, graphics.Quad, graphics.Shader, - graphics.SpriteBatch, graphics.Text, graphics.Texture, graphics.Video -- [ ] event.wait -- [ ] graphics.present -- [ ] graphics.drawInstanced -- [ ] graphics.setDepthMode (needs actual graphical comparison if possible) -- [ ] graphics.setFrontFaceWinding (needs actual graphical comparison if possible) -- [ ] graphics.setMeshCullMode (needs actual graphical comparison if possible) -- [ ] @deprecated setStencilTest (use setStencilMode) - [ ] @deprecated physics methods (sasha changes) -- [ ] check 12.0 wiki page for new methods -- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) -- [ ] ideally graphics.isCompressed should have an example of all compressed files love can take +- [ ] graphics.Mesh, graphics.ParticleSystem + graphics.SpriteBatch, graphics.Video +- [ ] graphics.drawInstanced +- [ ] @deprecated love.graphics.stencil (replaced by love.graphics.setStencilMode) +- [ ] @deprecated love.graphics.setStencilTest (replaced by love.graphics.setStencilMode) --- ## Future Goals -- [ ] Tests can compare visual results to a reference image (partially done) +- [ ] graphics.isCompressed should have an example of all compressed files love can take +- [ ] Tests can compare visual results to a reference image + This is partially done as we already save actual images for graphics tests to + use in the report output comparisons, so we just need to add a helper method + to the test class to let you just do assertMatching on the imgdata - [ ] Ability to test loading different combinations of modules - [ ] Performance tests diff --git a/testing/resources/font-letters-ab.png b/testing/resources/font-letters-ab.png new file mode 100644 index 0000000000000000000000000000000000000000..3ec8aeca38f5f5a67f9a3091b7cb5ab4a4fa8837 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&L!3HFEdh;y=QjEnx?oJHr&dIz4a(p~p978lF zZk^;P#9+X}y!i3|_-m`PF37zJ6u#`hW8m1!_`;;h(&nP<{kd-Zg2u<97Db-)-@kIP u;iMm@x>6s%%y2fYS~yp5_l~@;eZ24cd6o0SkG%q#%i!ti=d#Wzp$P!pIx=Vg literal 0 HcmV?d00001 diff --git a/testing/resources/font-letters-cd.png b/testing/resources/font-letters-cd.png new file mode 100644 index 0000000000000000000000000000000000000000..51190f648e5fbb176adecc71974896b33a6ad867 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&L!3HFEdh;y=QjEnx?oJHr&dIz4a(p~p978lF zUY%&j$DqK$-2L!>{IS3zVvk?+UQlMyX)yT0(hz-&Upe^gEq}@TPCjc)CrTy->zRIO tmiv(_@Ox51?b(hKeY!^Hx+X2NXKa1VE&otua|zH~22WQ%mvv4FO#r>iFv|b{ literal 0 HcmV?d00001 diff --git a/testing/resources/love_test_graphics_rectangle_expected.png b/testing/resources/love_test_graphics_rectangle_expected.png deleted file mode 100644 index bbbaf6edc47eb7d5a8fac65aa2688aff11068153..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|96eneLo9ml zPCm%TpupiIfA;_X)Lq;6q^$K_?;|kd(2PSY4W-+34zF0@%-wW?LHFs5+Drd+_ncPv iT=Tbyjb+uo&n(sUoQk=jADn=OF?hQAxvX Date: Wed, 15 Nov 2023 19:52:17 +0000 Subject: [PATCH 37/54] add renderer to report md --- testing/classes/TestSuite.lua | 6 +++++- testing/readme.md | 4 ++-- testing/tests/graphics.lua | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua index 39c76b472..c2c8c5dd1 100644 --- a/testing/classes/TestSuite.lua +++ b/testing/classes/TestSuite.lua @@ -136,6 +136,8 @@ TestSuite = { -- @return {nil} printResult = function(self) local finaltime = UtilTimeFormat(self.time) + + local name, version, vendor, device = love.graphics.getRendererInfo() local md = '\n\n' .. + ' || TIME ' .. finaltime .. ' -->\n\n### Info\n' .. '**' .. tostring(self.totals[1] + self.totals[2] + self.totals[3]) .. '** tests were completed in **' .. finaltime .. 's** with **' .. tostring(self.totals[1]) .. '** passed, **' .. @@ -152,7 +152,7 @@ TestSuite = { '### Report\n' .. '| Module | Pass | Fail | Skip | Time |\n' .. '| --------------------- | ------ | ------ | ------- | ------ |\n' .. - self.mdrows .. '\n\n### Failures\n' .. self.mdfailures + self.mdrows .. '\n### Failures\n' .. self.mdfailures local xml = '

🔴 love.test

  • 🟢 281 Tests
  • 🔴 2 Failures
  • 🟡 20 Skipped
  • 13.278s


🟢 love.audio