mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
rename test parameters to be simpler.
--runAllTests is now --all --runSpecificMethod is now --method --runSpecificModules is now --modules
This commit is contained in:
@@ -61,7 +61,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 --runAllTests --isRunner
|
||||
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --all --isRunner
|
||||
- name: Love Test Report (opengl)
|
||||
id: report1
|
||||
uses: ellraiser/love-test-report@main
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
- name: Run Test Suite (opengles)
|
||||
run: |
|
||||
export LOVE_GRAPHICS_USE_OPENGLES=1
|
||||
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner
|
||||
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --all --isRunner
|
||||
- name: Love Test Report (opengles)
|
||||
uses: ellraiser/love-test-report@main
|
||||
id: report2
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
# - name: Run Test Suite (vulkan)
|
||||
# run: |
|
||||
# export LOVE_GRAPHICS_DEBUG=1
|
||||
# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner --renderers vulkan
|
||||
# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --all --isRunner --renderers vulkan
|
||||
# - name: Love Test Report (vulkan)
|
||||
# uses: ellraiser/love-test-report@main
|
||||
# with:
|
||||
@@ -321,7 +321,7 @@ jobs:
|
||||
run: |
|
||||
echo 'check dir'
|
||||
ls
|
||||
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner
|
||||
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --all --isRunner
|
||||
- name: Love Test Report (opengl)
|
||||
id: report1
|
||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||
@@ -347,7 +347,7 @@ jobs:
|
||||
env:
|
||||
LOVE_GRAPHICS_USE_OPENGLES: 1
|
||||
run: |
|
||||
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner
|
||||
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --all --isRunner
|
||||
- name: Love Test Report (opengles)
|
||||
id: report2
|
||||
if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
|
||||
@@ -391,7 +391,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 --isRunner --renderers vulkan
|
||||
# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --all --isRunner --renderers vulkan
|
||||
# - name: Love Test Report (vulkan)
|
||||
# if: steps.vars.outputs.arch != 'ARM64'
|
||||
# uses: ellraiser/love-test-report@main
|
||||
@@ -444,7 +444,7 @@ jobs:
|
||||
- name: Run Test Suite
|
||||
run: |
|
||||
ls
|
||||
love-macos/love.app/Contents/MacOS/love ./testing/main.lua --runAllTests --isRunner
|
||||
love-macos/love.app/Contents/MacOS/love ./testing/main.lua --all --isRunner
|
||||
- name: Love Test Report
|
||||
id: report1
|
||||
uses: ellraiser/love-test-report@main
|
||||
|
||||
+16
-16
@@ -71,7 +71,7 @@ love.load = function(args)
|
||||
end
|
||||
|
||||
-- convert args to the cmd to run, modules, method (if any) and disabled
|
||||
local testcmd = '--runAllTests'
|
||||
local testcmd = '--all'
|
||||
local module = ''
|
||||
local method = ''
|
||||
local cmderr = 'Invalid flag used'
|
||||
@@ -82,7 +82,7 @@ love.load = function(args)
|
||||
}
|
||||
GITHUB_RUNNER = false
|
||||
for a=1,#arglist do
|
||||
if testcmd == '--runSpecificMethod' then
|
||||
if testcmd == '--method' then
|
||||
if module == '' and (arglist[a] == 'love' or love[ arglist[a] ] ~= nil) then
|
||||
module = arglist[a]
|
||||
table.insert(modules, module)
|
||||
@@ -90,16 +90,16 @@ love.load = function(args)
|
||||
if love.test[module][arglist[a]] ~= nil then method = arglist[a] end
|
||||
end
|
||||
end
|
||||
if testcmd == '--runSpecificModules' then
|
||||
if testcmd == '--modules' then
|
||||
if (arglist[a] == 'love' or love[ arglist[a] ] ~= nil) and arglist[a] ~= '--isRunner' then
|
||||
table.insert(modules, arglist[a])
|
||||
end
|
||||
end
|
||||
if arglist[a] == '--runSpecificMethod' then
|
||||
if arglist[a] == '--method' then
|
||||
testcmd = arglist[a]
|
||||
modules = {}
|
||||
end
|
||||
if arglist[a] == '--runSpecificModules' then
|
||||
if arglist[a] == '--modules' then
|
||||
testcmd = arglist[a]
|
||||
modules = {}
|
||||
end
|
||||
@@ -108,22 +108,22 @@ love.load = function(args)
|
||||
end
|
||||
end
|
||||
|
||||
-- runSpecificMethod uses the module + method given
|
||||
if testcmd == '--runSpecificMethod' then
|
||||
-- method uses the module + method given
|
||||
if testcmd == '--method' then
|
||||
local testmodule = TestModule:new(module, method)
|
||||
table.insert(love.test.modules, testmodule)
|
||||
if module ~= '' and method ~= '' then
|
||||
love.test.module = testmodule
|
||||
love.test.module:log('grey', '--runSpecificMethod "' .. module .. '" "' .. method .. '"')
|
||||
love.test.output = 'lovetest_runSpecificMethod_' .. module .. '_' .. method
|
||||
love.test.module:log('grey', '--method "' .. module .. '" "' .. method .. '"')
|
||||
love.test.output = 'lovetest_method_' .. 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
|
||||
if testcmd == '--runSpecificModules' then
|
||||
-- modules runs all methods for all the modules given
|
||||
if testcmd == '--modules' then
|
||||
local modulelist = {}
|
||||
for m=1,#modules do
|
||||
local testmodule = TestModule:new(modules[m])
|
||||
@@ -132,22 +132,22 @@ love.load = function(args)
|
||||
end
|
||||
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, '_')
|
||||
love.test.module:log('grey', '--modules "' .. table.concat(modulelist, '" "') .. '"')
|
||||
love.test.output = 'lovetest_modules_' .. table.concat(modulelist, '_')
|
||||
else
|
||||
cmderr = 'No modules specified'
|
||||
end
|
||||
end
|
||||
|
||||
-- otherwise default runs all methods for all modules
|
||||
if arglist[1] == nil or arglist[1] == '' or arglist[1] == '--runAllTests' then
|
||||
if arglist[1] == nil or arglist[1] == '' or arglist[1] == '--all' then
|
||||
for m=1,#modules do
|
||||
local testmodule = TestModule:new(modules[m])
|
||||
table.insert(love.test.modules, testmodule)
|
||||
end
|
||||
love.test.module = love.test.modules[1]
|
||||
love.test.module:log('grey', '--runAllTests')
|
||||
love.test.output = 'lovetest_runAllTests'
|
||||
love.test.module:log('grey', '--all')
|
||||
love.test.output = 'lovetest_all'
|
||||
end
|
||||
|
||||
if GITHUB_RUNNER then
|
||||
|
||||
+2
-2
@@ -52,9 +52,9 @@ LINUX: `./love.AppImage PATH_TO_TESTING_FOLDER/main.lua`
|
||||
|
||||
By default all tests will be run for all modules.
|
||||
If you want to specify a module/s you can use:
|
||||
`--runSpecificModules filesystem,audio`
|
||||
`--modules filesystem,audio`
|
||||
If you want to specify only 1 specific method only you can use:
|
||||
`--runSpecificMethod filesystem write`
|
||||
`--method 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user