2020-09-25 21:01:48 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
|
|
|
version = "0.1.0"
|
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
description = "A wrapper for SQLCipher"
|
|
|
|
license = "MIT"
|
|
|
|
skipDirs = @["test"]
|
|
|
|
|
|
|
|
requires "nim >= 1.2.0",
|
|
|
|
"nimterop"
|
|
|
|
|
2020-10-22 22:38:30 +00:00
|
|
|
import strutils
|
|
|
|
|
2020-09-25 21:01:48 +00:00
|
|
|
proc buildAndRunTest(name: string,
|
|
|
|
srcDir = "test/",
|
|
|
|
outDir = "test/build/",
|
|
|
|
params = "",
|
|
|
|
cmdParams = "",
|
|
|
|
lang = "c") =
|
|
|
|
rmdir outDir
|
|
|
|
mkDir outDir
|
|
|
|
# allow something like "nim test --verbosity:0 --hints:off beacon_chain.nims"
|
|
|
|
var extra_params = params
|
|
|
|
for i in 2..<paramCount():
|
|
|
|
extra_params &= " " & paramStr(i)
|
|
|
|
exec "nim " &
|
|
|
|
lang &
|
|
|
|
" --debugger:native" &
|
|
|
|
" --define:debug" &
|
|
|
|
" --define:ssl" &
|
2020-10-23 21:39:06 +00:00
|
|
|
(if getEnv("SSL_STATIC").strip != "false": " --dynlibOverride:ssl" else: "") &
|
2020-09-25 21:01:48 +00:00
|
|
|
" --nimcache:nimcache/test/" & name &
|
|
|
|
" --out:" & outDir & name &
|
2020-10-22 22:38:30 +00:00
|
|
|
(if getEnv("SSL_LDFLAGS").strip != "": " --passL:\"" & getEnv("SSL_LDFLAGS") & "\"" else: "") &
|
2020-09-25 21:01:48 +00:00
|
|
|
" --threads:on" &
|
|
|
|
" --tlsEmulation:off" &
|
|
|
|
" " &
|
|
|
|
extra_params &
|
|
|
|
" " &
|
|
|
|
srcDir & name & ".nim" &
|
|
|
|
" " &
|
|
|
|
cmdParams
|
|
|
|
exec outDir & name
|
|
|
|
|
|
|
|
task tests, "Run all tests":
|
|
|
|
buildAndRunTest "db_smoke"
|