2018-12-18 17:39:39 +02:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
2019-07-06 19:12:24 +02:00
|
|
|
packageName = "stew"
|
2018-12-18 17:39:39 +02:00
|
|
|
version = "0.1.0"
|
|
|
|
author = "Status Research & Development GmbH"
|
2019-05-08 14:05:16 -06:00
|
|
|
description = "Backports, standard library candidates and small utilities that don't yet deserve their own repository"
|
2018-12-18 17:39:39 +02:00
|
|
|
license = "Apache License 2.0"
|
|
|
|
skipDirs = @["tests"]
|
|
|
|
|
2022-07-08 10:34:21 +01:00
|
|
|
requires "nim >= 1.2.0",
|
|
|
|
"unittest2"
|
2019-07-06 20:00:37 +02:00
|
|
|
|
2021-01-07 10:33:01 +07:00
|
|
|
### Helper functions
|
2022-01-02 06:49:51 +01:00
|
|
|
proc test(args, path: string) =
|
2021-01-07 10:33:01 +07:00
|
|
|
# Compilation language is controlled by TEST_LANG
|
2022-08-05 19:58:34 +03:00
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") &
|
|
|
|
" " & args &
|
2022-09-22 08:16:32 +07:00
|
|
|
" -r --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error" &
|
|
|
|
" " & path
|
2022-08-05 19:58:34 +03:00
|
|
|
|
|
|
|
proc buildHelper(args, path: string) =
|
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") &
|
|
|
|
" " & args &
|
2022-09-22 08:16:32 +07:00
|
|
|
" --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error" &
|
|
|
|
" " & path
|
2021-01-07 10:33:01 +07:00
|
|
|
|
2019-07-06 20:00:37 +02:00
|
|
|
task test, "Run all tests":
|
2022-08-05 19:58:34 +03:00
|
|
|
# Building `test_helper.nim`.
|
|
|
|
buildHelper("", "tests/test_helper")
|
2021-01-07 10:33:01 +07:00
|
|
|
test "--threads:off", "tests/all_tests"
|
|
|
|
test "--threads:on -d:nimTypeNames", "tests/all_tests"
|
2022-08-05 19:58:34 +03:00
|
|
|
test "--threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians",
|
|
|
|
"tests/all_tests"
|
2020-06-15 21:09:41 +07:00
|
|
|
|
|
|
|
task testvcc, "Run all tests with vcc compiler":
|
2022-08-05 19:58:34 +03:00
|
|
|
# Building `test_helper.nim`.
|
|
|
|
buildHelper("--cc:vcc", "tests/test_helper")
|
2021-01-07 10:33:01 +07:00
|
|
|
test "--cc:vcc --threads:off", "tests/all_tests"
|
|
|
|
test "--cc:vcc --threads:on -d:nimTypeNames", "tests/all_tests"
|
2022-08-05 19:58:34 +03:00
|
|
|
test "--cc:vcc --threads:on -d:noIntrinsicsBitOpts -d:noIntrinsicsEndians",
|
|
|
|
"tests/all_tests"
|