fix regression: -d:nimHasLibFFI was not being tested anymore (#14234)

* * fix regression: -d:nimHasLibFFI was not being tested anymore,
in part because testament was silently treating some errors as easy to overlook messages
* turned that message into an error
* -d:nimHasLibFFI is now being tested with nim cpp
* use correct signatures for importc procs
* workaround for openbsd to unblock ctffi testing
This commit is contained in:
Timothee Cour 2020-05-06 08:16:54 -07:00 • committed by GitHub
commit 330b3c4453
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 26 deletions

View file

@ -289,11 +289,13 @@ proc findStartNim: string =
proc thVersion(i: int): string =
result = ("compiler" / "nim" & $i).exe
template doUseCpp(): bool = getEnv("NIM_COMPILE_TO_CPP", "false") == "true"
proc boot(args: string) =
var output = "compiler" / "nim".exe
var finalDest = "bin" / "nim".exe
# default to use the 'c' command:
let useCpp = getEnv("NIM_COMPILE_TO_CPP", "false") == "true"
let useCpp = doUseCpp()
let smartNimcache = (if "release" in args or "danger" in args: "nimcache/r_" else: "nimcache/d_") &
hostOS & "_" & hostCPU
@ -542,8 +544,9 @@ proc runCI(cmd: string) =
execFold("nimble install -y libffi", "nimble install -y libffi")
const nimFFI = "./bin/nim.ctffi"
# no need to bootstrap with koch boot (would be slower)
execFold("build with -d:nimHasLibFFI", "nim c -d:release -d:nimHasLibFFI -o:$1 compiler/nim.nim" % [nimFFI])
execFold("test with -d:nimHasLibFFI", "$1 c -r testament/testament --nim:$1 r tests/vm/tevalffi.nim" % [nimFFI])
let backend = if doUseCpp(): "cpp" else: "c"
execFold("build with -d:nimHasLibFFI", "nim $1 -d:release -d:nimHasLibFFI -o:$2 compiler/nim.nim" % [backend, nimFFI])
execFold("test with -d:nimHasLibFFI", "$1 $2 -r testament/testament --nim:$1 r tests/trunner.nim" % [nimFFI, backend])
execFold("Run nimdoc tests", "nim c -r nimdoc/tester")
execFold("Run nimpretty tests", "nim c -r nimpretty/tester.nim")