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

Expected

Actual

Expected

Actual

Expected

Actual