summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-03-03 23:13:27 +0800
committerGitHub <noreply@github.com>2023-03-03 23:13:27 +0800
commit2e2affb13ce13723e5ab1996d05f7b82c184a090 (patch)
tree52ef6acd63b3a6e748e14aa1cddafc25851a76e8
parentd51a392149df1c0783fa526eabbc904ce0cd0cbd (diff)
downloadNim-2e2affb13ce13723e5ab1996d05f7b82c184a090.tar.gz
test DLL generation with ORC (#21445)
* test DLL generation with ORC

* fixes

* fixes refc

* Update testament/categories.nim
-rw-r--r--testament/categories.nim24
1 files changed, 15 insertions, 9 deletions
diff --git a/testament/categories.nim b/testament/categories.nim
index cae699327..c428ffc04 100644
--- a/testament/categories.nim
+++ b/testament/categories.nim
@@ -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"