fix xml format

This commit is contained in:
ell
2023-10-06 00:37:35 +01:00
parent db600b7fb6
commit fae3b6ff63
4 changed files with 18 additions and 19 deletions
+8
View File
@@ -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:
+4 -3
View File
@@ -309,14 +309,15 @@ TestMethod = {
output = self.result.key .. ' ' .. self.result.message
end
if output == '' and self.skipped == true then
failure = '\t\t\t<skipped message="' .. self.skipreason .. '></skipped>'
output = self.skipreason
end
-- append XML for the test class result
self.testmodule.xml = self.testmodule.xml .. '\t\t<testclass classname="' ..
self.method .. '" name="' .. self.method ..
self.testmodule.xml = self.testmodule.xml .. '\t\t<testcase classname="' ..
self.method .. '" name="' .. self.method .. '" assertions="' .. tostring(#self.asserts) ..
'" time="' .. endtime .. '">\n' ..
failure .. '\t\t</testclass>\n'
failure .. '\t\t</testcase>\n'
-- unused currently, adds a preview image for certain graphics methods to the output
local preview = ''
-2
View File
@@ -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 .. '</testsuites>')
love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '</div></body></html>')
+6 -14
View File
@@ -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?