2022-01-14 09:51:22 +00:00
|
|
|
import os, strutils
|
|
|
|
|
2020-12-21 11:45:07 +00:00
|
|
|
# Package
|
|
|
|
version = "0.1.5"
|
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
description = "BearSSL wrapper"
|
|
|
|
license = "MIT or Apache License 2.0"
|
2021-06-09 14:59:52 +00:00
|
|
|
mode = ScriptMode.Verbose
|
2020-12-21 11:45:07 +00:00
|
|
|
|
|
|
|
# Dependencies
|
2022-01-14 09:51:22 +00:00
|
|
|
requires "nim >= 1.2.0",
|
|
|
|
"unittest2"
|
2021-02-02 11:46:38 +00:00
|
|
|
|
|
|
|
### Helper functions
|
|
|
|
proc test(env, path: string) =
|
|
|
|
# Compilation language is controlled by TEST_LANG
|
2022-01-14 09:51:22 +00:00
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & env &
|
|
|
|
" -rf --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error " & path
|
2021-02-02 11:46:38 +00:00
|
|
|
|
|
|
|
task test, "Run tests":
|
2022-01-14 09:51:22 +00:00
|
|
|
for path in listFiles(thisDir() / "tests"):
|
|
|
|
if path.split(".")[^1] != "nim":
|
|
|
|
continue
|
|
|
|
test "-d:debug", path
|
|
|
|
test "-d:release", path
|
|
|
|
test "--gc:arc -d:release", path
|
|
|
|
rmFile(path[0..^5].toExe())
|