Browse Source

rename test parameters to be simpler.

--runAllTests is now --all
--runSpecificMethod is now --method
--runSpecificModules is now --modules
Sasha Szpakowski 1 year ago
parent
commit
a07503c3f5
3 changed files with 25 additions and 25 deletions
  1. 7 7
      .github/workflows/main.yml
  2. 16 16
      testing/main.lua
  3. 2 2
      testing/readme.md

+ 7 - 7
.github/workflows/main.yml

@@ -61,7 +61,7 @@ jobs:
     - name: Run Test Suite (opengl)
     - name: Run Test Suite (opengl)
       run: |
       run: |
         chmod a+x love-${{ github.sha }}.AppImage
         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)
     - name: Love Test Report (opengl)
       id: report1
       id: report1
       uses: ellraiser/love-test-report@main
       uses: ellraiser/love-test-report@main
@@ -82,7 +82,7 @@ jobs:
     - name: Run Test Suite (opengles)
     - name: Run Test Suite (opengles)
       run: |
       run: |
         export LOVE_GRAPHICS_USE_OPENGLES=1
         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)
     - name: Love Test Report (opengles)
       uses: ellraiser/love-test-report@main
       uses: ellraiser/love-test-report@main
       id: report2
       id: report2
@@ -103,7 +103,7 @@ jobs:
 #    - name: Run Test Suite (vulkan)
 #    - name: Run Test Suite (vulkan)
 #      run: |
 #      run: |
 #        export LOVE_GRAPHICS_DEBUG=1
 #        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)
 #    - name: Love Test Report (vulkan)
 #      uses: ellraiser/love-test-report@main
 #      uses: ellraiser/love-test-report@main
 #      with:
 #      with:
@@ -321,7 +321,7 @@ jobs:
       run: |
       run: |
         echo 'check dir'
         echo 'check dir'
         ls
         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)
     - name: Love Test Report (opengl)
       id: report1
       id: report1
       if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
       if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
@@ -347,7 +347,7 @@ jobs:
       env:
       env:
         LOVE_GRAPHICS_USE_OPENGLES: 1
         LOVE_GRAPHICS_USE_OPENGLES: 1
       run: |
       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)
     - name: Love Test Report (opengles)
       id: report2
       id: report2
       if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
       if: steps.vars.outputs.arch != 'ARM64' && steps.vars.outputs.compatname != '-compat'
@@ -391,7 +391,7 @@ jobs:
 #      if: steps.vars.outputs.arch != 'ARM64'
 #      if: steps.vars.outputs.arch != 'ARM64'
 #      run: |
 #      run: |
 #        $ENV:LOVE_GRAPHICS_DEBUG=1
 #        $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)
 #    - name: Love Test Report (vulkan)
 #      if: steps.vars.outputs.arch != 'ARM64'
 #      if: steps.vars.outputs.arch != 'ARM64'
 #      uses: ellraiser/love-test-report@main
 #      uses: ellraiser/love-test-report@main
@@ -444,7 +444,7 @@ jobs:
     - name: Run Test Suite
     - name: Run Test Suite
       run: |
       run: |
         ls
         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
     - name: Love Test Report
       id: report1
       id: report1
       uses: ellraiser/love-test-report@main
       uses: ellraiser/love-test-report@main

+ 16 - 16
testing/main.lua

@@ -71,7 +71,7 @@ love.load = function(args)
   end
   end
 
 
   -- convert args to the cmd to run, modules, method (if any) and disabled
   -- convert args to the cmd to run, modules, method (if any) and disabled
-  local testcmd = '--runAllTests'
+  local testcmd = '--all'
   local module = ''
   local module = ''
   local method = ''
   local method = ''
   local cmderr = 'Invalid flag used'
   local cmderr = 'Invalid flag used'
@@ -82,7 +82,7 @@ love.load = function(args)
   }
   }
   GITHUB_RUNNER = false
   GITHUB_RUNNER = false
   for a=1,#arglist do
   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 
       if module == '' and (arglist[a] == 'love' or love[ arglist[a] ] ~= nil) then 
         module = arglist[a] 
         module = arglist[a] 
         table.insert(modules, module)
         table.insert(modules, module)
@@ -90,16 +90,16 @@ love.load = function(args)
         if love.test[module][arglist[a]] ~= nil then method = arglist[a] end
         if love.test[module][arglist[a]] ~= nil then method = arglist[a] end
       end
       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 
       if (arglist[a] == 'love' or love[ arglist[a] ] ~= nil) and arglist[a] ~= '--isRunner' then 
         table.insert(modules, arglist[a]) 
         table.insert(modules, arglist[a]) 
       end
       end
     end
     end
-    if arglist[a] == '--runSpecificMethod' then
+    if arglist[a] == '--method' then
       testcmd = arglist[a]
       testcmd = arglist[a]
       modules = {}
       modules = {}
     end
     end
-    if arglist[a] == '--runSpecificModules' then
+    if arglist[a] == '--modules' then
       testcmd = arglist[a]
       testcmd = arglist[a]
       modules = {}
       modules = {}
     end
     end
@@ -108,22 +108,22 @@ love.load = function(args)
     end
     end
   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)
     local testmodule = TestModule:new(module, method)
     table.insert(love.test.modules, testmodule)
     table.insert(love.test.modules, testmodule)
     if module ~= '' and method ~= '' then
     if module ~= '' and method ~= '' then
       love.test.module = testmodule
       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
     else
       if method == '' then cmderr = 'No valid method specified' end
       if method == '' then cmderr = 'No valid method specified' end
       if module == '' then cmderr = 'No valid module specified' end
       if module == '' then cmderr = 'No valid module specified' end
     end
     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 = {}
     local modulelist = {}
     for m=1,#modules do
     for m=1,#modules do
       local testmodule = TestModule:new(modules[m])
       local testmodule = TestModule:new(modules[m])
@@ -132,22 +132,22 @@ love.load = function(args)
     end
     end
     if #modulelist > 0 then
     if #modulelist > 0 then
       love.test.module = love.test.modules[1]
       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
     else
       cmderr = 'No modules specified'
       cmderr = 'No modules specified'
     end
     end
   end
   end
 
 
   -- otherwise default runs all methods for all modules
   -- 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
     for m=1,#modules do
       local testmodule = TestModule:new(modules[m])
       local testmodule = TestModule:new(modules[m])
       table.insert(love.test.modules, testmodule)
       table.insert(love.test.modules, testmodule)
     end
     end
     love.test.module = love.test.modules[1]
     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
   end
 
 
   if GITHUB_RUNNER then
   if GITHUB_RUNNER then

+ 2 - 2
testing/readme.md

@@ -52,9 +52,9 @@ LINUX: `./love.AppImage PATH_TO_TESTING_FOLDER/main.lua`
 
 
 By default all tests will be run for all modules.  
 By default all tests will be run for all modules.  
 If you want to specify a module/s you can use:  
 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:  
 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.  
 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.