From 159efe12578bd2063713d27af81c8e0e5b2cb108 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 5 May 2022 18:51:36 +0200 Subject: [PATCH] Transfer test programs as well for cross-testing --- .github/workflows/testing.yml | 23 +++++++++++++++++++---- Makefile | 6 ++++-- test/gfx/rgbgfx_test.cpp | 6 +++--- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a726c5de..6fab88ca 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -51,7 +51,7 @@ jobs: mkdir bins cp rgb{asm,link,fix,gfx} bins - name: Upload binaries - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.buildsys }} path: bins @@ -134,7 +134,7 @@ jobs: mkdir bins cp install_dir/bin/{rgbasm.exe,rgblink.exe,rgbfix.exe,rgbgfx.exe,zlib1.dll,libpng16.dll} bins - name: Upload Windows binaries - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: rgbds-canary-win${{ matrix.bits }} path: bins @@ -186,11 +186,20 @@ jobs: cp /usr/${{ matrix.triplet }}/lib/zlib1.dll bins cp /usr/${{ matrix.triplet }}/bin/libpng16-16.dll bins if [ ${{ matrix.bits }} -eq 32 ]; then cp /usr/lib/gcc/${{ matrix.triplet }}/7.3-win32/lib{gcc_s_sjlj-1,stdc++-6}.dll bins; fi + mv test/gfx/randtilegen{,.exe} + mv test/gfx/rgbgfx_test{,.exe} - name: Upload Windows binaries - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: rgbds-canary-mingw-win${{ matrix.bits }} path: bins + - name: Upload Windows test binaries + uses: actions/upload-artifact@v3 + with: + name: testing-programs-mingw-win${{ matrix.bits }} + path: | + test/gfx/randtilegen.exe + test/gfx/rgbgfx_test.exe windows-xtesting: needs: windows-xbuild @@ -202,14 +211,20 @@ jobs: steps: - uses: actions/checkout@v2 - name: Retrieve binaries - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: name: rgbds-canary-mingw-win${{ matrix.bits }} path: bins + - name: Retrieve test binaries + uses: actions/download-artifact@v3 + with: + name: testing-programs-mingw-win${{ matrix.bits }} + path: test/gfx - name: Extract binaries shell: bash run: | cp bins/* . + cp bins/*.dll test/gfx - name: Run tests shell: bash run: | diff --git a/Makefile b/Makefile index 7e3b6cd5..49946300 100644 --- a/Makefile +++ b/Makefile @@ -254,11 +254,13 @@ develop: # install instructions instead. mingw32: - $Q${MAKE} CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ \ + $Q${MAKE} all test/gfx/randtilegen test/gfx/rgbgfx_test \ + CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ \ BISON=bison PKG_CONFIG=i686-w64-mingw32-pkg-config -j mingw64: - $Q${MAKE} CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ \ + $Q${MAKE} all test/gfx/randtilegen test/gfx/rgbgfx_test \ + CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ \ BISON=bison PKG_CONFIG=x86_64-w64-mingw32-pkg-config -j wine-shim: diff --git a/test/gfx/rgbgfx_test.cpp b/test/gfx/rgbgfx_test.cpp index 0c41112e..641a4cd0 100644 --- a/test/gfx/rgbgfx_test.cpp +++ b/test/gfx/rgbgfx_test.cpp @@ -1,6 +1,6 @@ // For `execProg` (Windows is its special little snowflake again) -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__MINGW32__) #include #include @@ -280,7 +280,7 @@ public: }; static char *execProg(char const *name, char * const *argv) { -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__MINGW32__) pid_t pid; int err = posix_spawn(&pid, argv[0], nullptr, nullptr, argv, nullptr); if (err != 0) { @@ -298,7 +298,7 @@ static char *execProg(char const *name, char * const *argv) { fatal("%s returned with status %d", name, info.si_status); } -#else /* defined(_MSC_VER) */ +#else /* defined(_MSC_VER) || defined(__MINGW32__) */ auto winStrerror = [](DWORD errnum) { LPTSTR buf;