2023-03-24 13:02:38 +00:00
|
|
|
import strutils
|
|
|
|
from os import DirSep
|
|
|
|
|
|
|
|
const
|
|
|
|
testPath = currentSourcePath.rsplit(DirSep, 1)[0] & "/tests"
|
|
|
|
|
2023-03-08 13:04:30 +00:00
|
|
|
# Helper functions
|
|
|
|
proc test(args, path: string) =
|
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args &
|
|
|
|
" --outdir:build -r -f --hints:off --warnings:off --skipParentCfg " & path
|
|
|
|
|
2023-03-24 13:02:38 +00:00
|
|
|
proc runAllTest*() =
|
2023-03-08 13:04:30 +00:00
|
|
|
echo ">>>>>>>>>>>>>>>> Run tests in DEBUG mode <<<<<<<<<<<<<<<<"
|
2023-03-24 13:02:38 +00:00
|
|
|
test "-d:debug", testPath & "/test_all"
|
2023-03-08 13:04:30 +00:00
|
|
|
echo ">>>>>>>>>>>>>>>> Run tests in RELEASE mode <<<<<<<<<<<<<<<<"
|
2023-03-24 13:02:38 +00:00
|
|
|
test "-d:release", testPath & "/test_all"
|
2023-03-08 13:04:30 +00:00
|
|
|
echo ">>>>>>>>>>>>>>>> Run tests in RELEASE and THREADS ON mode <<<<<<<<<<<<<<<<"
|
2023-03-24 13:02:38 +00:00
|
|
|
test "--threads:on -d:release", testPath & "/test_all"
|
|
|
|
|
|
|
|
task test, "Run all tests":
|
|
|
|
runAllTest()
|