diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43cf1b4..7b42318 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,13 +184,13 @@ jobs: run: | env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble test - - name: Setup VCC (i386) + - name: Setup VCC (Windows-i386) if: runner.os == 'Windows' && matrix.target.cpu == 'i386' uses: ilammy/msvc-dev-cmd@v1.5.0 with: arch: amd64_x86 - - name: Setup VCC (amd64) + - name: Setup VCC (Windows-amd64) if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' uses: ilammy/msvc-dev-cmd@v1.5.0 with: @@ -200,4 +200,5 @@ jobs: if: runner.os == 'Windows' shell: cmd working-directory: nim-stew - run: nimble testvcc + run: | + env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble testvcc diff --git a/stew.nimble b/stew.nimble index 22c774e..f8ca16a 100644 --- a/stew.nimble +++ b/stew.nimble @@ -9,11 +9,22 @@ skipDirs = @["tests"] requires "nim >= 1.2.0" +### Helper functions +proc test(env, path: string) = + # Compilation language is controlled by TEST_LANG + var lang = "c" + if existsEnv"TEST_LANG": + lang = getEnv"TEST_LANG" + + exec "nim " & lang & " " & env & + " -r --hints:off --warnings:off " & path + task test, "Run all tests": - exec "nim c -r --threads:off tests/all_tests" - exec "nim c -r --threads:on -d:nimTypeNames tests/all_tests" - exec "nim c -r --threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians tests/all_tests" + test "--threads:off", "tests/all_tests" + test "--threads:on -d:nimTypeNames", "tests/all_tests" + test "--threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians", "tests/all_tests" task testvcc, "Run all tests with vcc compiler": - exec "nim c -r --cc:vcc --threads:off tests/all_tests" - exec "nim c -r --cc:vcc --threads:on -d:nimTypeNames tests/all_tests" + test "--cc:vcc --threads:off", "tests/all_tests" + test "--cc:vcc --threads:on -d:nimTypeNames", "tests/all_tests" + test "--cc:vcc --threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians", "tests/all_tests"