github CI: fixes backend selection

This commit is contained in:
jangko 2021-01-07 10:33:01 +07:00
parent 1401c34374
commit 87096ee9ac
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 20 additions and 8 deletions

View File

@ -184,13 +184,13 @@ jobs:
run: | run: |
env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble test 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' if: runner.os == 'Windows' && matrix.target.cpu == 'i386'
uses: ilammy/msvc-dev-cmd@v1.5.0 uses: ilammy/msvc-dev-cmd@v1.5.0
with: with:
arch: amd64_x86 arch: amd64_x86
- name: Setup VCC (amd64) - name: Setup VCC (Windows-amd64)
if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' if: runner.os == 'Windows' && matrix.target.cpu == 'amd64'
uses: ilammy/msvc-dev-cmd@v1.5.0 uses: ilammy/msvc-dev-cmd@v1.5.0
with: with:
@ -200,4 +200,5 @@ jobs:
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: cmd shell: cmd
working-directory: nim-stew working-directory: nim-stew
run: nimble testvcc run: |
env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble testvcc

View File

@ -9,11 +9,22 @@ skipDirs = @["tests"]
requires "nim >= 1.2.0" 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": task test, "Run all tests":
exec "nim c -r --threads:off tests/all_tests" test "--threads:off", "tests/all_tests"
exec "nim c -r --threads:on -d:nimTypeNames tests/all_tests" test "--threads:on -d:nimTypeNames", "tests/all_tests"
exec "nim c -r --threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians tests/all_tests" test "--threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians", "tests/all_tests"
task testvcc, "Run all tests with vcc compiler": task testvcc, "Run all tests with vcc compiler":
exec "nim c -r --cc:vcc --threads:off tests/all_tests" test "--cc:vcc --threads:off", "tests/all_tests"
exec "nim c -r --cc:vcc --threads:on -d:nimTypeNames 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"