allow running tests with custom nim

This commit is contained in:
Jacek Sieka 2023-06-26 14:50:18 +02:00
parent 4014ef939b
commit e99be09375
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
1 changed files with 10 additions and 8 deletions

View File

@ -12,21 +12,23 @@ requires "nim > 0.18.0"
# Tests
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
task test, "Runs the test suite":
var testCommands = @[
"nim c -f -r tests/",
"nim c -f -d:danger -r tests/",
"nim c -f -d:danger --threads:on -r tests/",
nimc & " c -f -r tests/",
nimc & " c -f -d:danger -r tests/",
nimc & " c -f -d:danger --threads:on -r tests/",
]
when (NimMajor, NimMinor) >= (1, 5):
testCommands.add "nim c -f --gc:orc --threads:on -r tests/"
testCommands.add(nimc & " c -f --gc:orc --threads:on -r tests/")
let exampleFiles = @[
"ecb", "cbc", "ofb", "cfb", "ctr", "gcm"
]
var exampleCommands = @[
"nim c -f -r --threads:on examples/",
nimc & " c -f -r --threads:on examples/",
]
when (NimMajor, NimMinor) >= (1, 5):
@ -43,6 +45,6 @@ task test, "Runs the test suite":
exec cmd & efile
rmFile("examples/" & efile.toExe())
exec("nim c -f -r -d:nimcryptoLowercase tests/testapi")
exec("nim c -f -r -d:nimcrypto0xPrefix tests/testapi")
exec("nim c -f -r -d:nimcrypto0xPrefix -d:nimcryptoLowercase tests/testapi")
exec(nimc & " c -f -r -d:nimcryptoLowercase tests/testapi")
exec(nimc & " c -f -r -d:nimcrypto0xPrefix tests/testapi")
exec(nimc & " c -f -r -d:nimcrypto0xPrefix -d:nimcryptoLowercase tests/testapi")