2021-12-12 00:01:56 +01:00
|
|
|
import os, strutils
|
|
|
|
|
|
2019-09-30 21:23:06 +03:00
|
|
|
# Package
|
2020-03-08 20:28:15 +02:00
|
|
|
version = "0.1.5"
|
2019-09-30 21:23:06 +03:00
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
|
description = "BearSSL wrapper"
|
|
|
|
|
license = "MIT or Apache License 2.0"
|
2021-06-03 03:02:00 +02:00
|
|
|
mode = ScriptMode.Verbose
|
2019-09-30 21:23:06 +03:00
|
|
|
|
|
|
|
|
# Dependencies
|
2021-12-12 00:01:56 +01:00
|
|
|
requires "nim >= 1.2.0",
|
|
|
|
|
"unittest2"
|
2021-01-13 09:10:01 +07:00
|
|
|
|
|
|
|
|
### Helper functions
|
|
|
|
|
proc test(env, path: string) =
|
|
|
|
|
# Compilation language is controlled by TEST_LANG
|
2021-12-12 00:01:56 +01:00
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & env &
|
2022-06-14 19:33:00 +02:00
|
|
|
" -d:bearsslSplitAbi -rf --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error " & path
|
2021-01-13 09:10:01 +07:00
|
|
|
|
|
|
|
|
task test, "Run tests":
|
2021-12-12 00:01:56 +01: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())
|