diff options
-rw-r--r-- | tests/specials.nim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/specials.nim b/tests/specials.nim index 3d4c8cfc4..d10452b98 100644 --- a/tests/specials.nim +++ b/tests/specials.nim @@ -65,6 +65,12 @@ proc compileRodFiles(r: var TResults, options: string) = # --------------------- DLL generation tests ---------------------------------- +proc safeCopyFile(src, dest: string) = + try: + copyFile(src, dest) + except EOS: + echo "[Warning] could not copy: ", src, " to ", dest + proc runBasicDLLTest(c, r: var TResults, options: string) = compileSingleTest c, "lib/nimrtl.nim", options & " --app:lib -d:createNimRtl" compileSingleTest c, "tests/dll/server.nim", @@ -73,14 +79,14 @@ proc runBasicDLLTest(c, r: var TResults, options: string) = when defined(Windows): # windows looks in the dir of the exe (yay!): var nimrtlDll = DynlibFormat % "nimrtl" - copyFile("lib" / nimrtlDll, "tests/dll" / nimrtlDll) + safeCopyFile("lib" / nimrtlDll, "tests/dll" / nimrtlDll) else: # posix relies on crappy LD_LIBRARY_PATH (ugh!): var libpath = getenv"LD_LIBRARY_PATH".string if peg"\i '/nimrod' (!'/')* '/lib'" notin libpath: echo "[Warning] insufficient LD_LIBRARY_PATH" var serverDll = DynlibFormat % "server" - copyFile("tests/dll" / serverDll, "lib" / serverDll) + safeCopyFile("tests/dll" / serverDll, "lib" / serverDll) runSingleTest r, "tests/dll/client.nim", options & " -d:useNimRtl" |