mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
test DLL generation with ORC (#21445)
* test DLL generation with ORC * fixes * fixes refc * Update testament/categories.nim
This commit is contained in:
@@ -47,21 +47,24 @@ proc isTestFile*(file: string): bool =
|
||||
|
||||
# --------------------- DLL generation tests ----------------------------------
|
||||
|
||||
proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
|
||||
proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string, isOrc = false) =
|
||||
const rpath = when defined(macosx):
|
||||
" --passL:-rpath --passL:@loader_path"
|
||||
else:
|
||||
""
|
||||
|
||||
var test1 = makeTest("lib/nimrtl.nim", options & " --outdir:tests/dll", cat)
|
||||
test1.spec.action = actionCompile
|
||||
testSpec c, test1
|
||||
if not defined(windows) or not isOrc: # todo fix me on windows
|
||||
var test1 = makeTest("lib/nimrtl.nim", options & " --outdir:tests/dll", cat)
|
||||
test1.spec.action = actionCompile
|
||||
testSpec c, test1
|
||||
var test2 = makeTest("tests/dll/server.nim", options & " --threads:on" & rpath, cat)
|
||||
test2.spec.action = actionCompile
|
||||
testSpec c, test2
|
||||
var test3 = makeTest("lib/nimhcr.nim", options & " --threads:off --outdir:tests/dll" & rpath, cat)
|
||||
test3.spec.action = actionCompile
|
||||
testSpec c, test3
|
||||
|
||||
if not isOrc:
|
||||
var test3 = makeTest("lib/nimhcr.nim", options & " --threads:off --outdir:tests/dll" & rpath, cat)
|
||||
test3.spec.action = actionCompile
|
||||
testSpec c, test3
|
||||
var test4 = makeTest("tests/dll/visibility.nim", options & " --threads:off --app:lib" & rpath, cat)
|
||||
test4.spec.action = actionCompile
|
||||
testSpec c, test4
|
||||
@@ -76,8 +79,9 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
|
||||
putEnv(libpathenv, "tests/dll" & (if libpath.len > 0: ":" & libpath else: ""))
|
||||
defer: putEnv(libpathenv, libpath)
|
||||
|
||||
testSpec r, makeTest("tests/dll/client.nim", options & " --threads:on" & rpath, cat)
|
||||
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & " --threads:off" & rpath, cat)
|
||||
if not isOrc:
|
||||
testSpec r, makeTest("tests/dll/client.nim", options & " --threads:on" & rpath, cat)
|
||||
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & " --threads:off" & rpath, cat)
|
||||
testSpec r, makeTest("tests/dll/visibility.nim", options & " --threads:off" & rpath, cat)
|
||||
|
||||
if "boehm" notin options:
|
||||
@@ -96,6 +100,8 @@ proc dllTests(r: var TResults, cat: Category, options: string) =
|
||||
|
||||
runBasicDLLTest c, r, cat, options & " --mm:refc"
|
||||
runBasicDLLTest c, r, cat, options & " -d:release --mm:refc"
|
||||
runBasicDLLTest c, r, cat, options, isOrc = true
|
||||
runBasicDLLTest c, r, cat, options & " -d:release", isOrc = true
|
||||
when not defined(windows):
|
||||
# still cannot find a recent Windows version of boehm.dll:
|
||||
runBasicDLLTest c, r, cat, options & " --gc:boehm"
|
||||
|
||||
Reference in New Issue
Block a user