summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-02-06 00:28:35 +0100
committerAraq <rumpf_a@web.de>2012-02-06 00:28:35 +0100
commitfd4836a5d6e4e2c7b37adc6efdea325b76b9d59f (patch)
treed88b4e75aae609e4bce94c3721b66f04d1238bee /tests
parenta501e73bf992b3d4ee3c412f22a8705014bcba49 (diff)
downloadNim-fd4836a5d6e4e2c7b37adc6efdea325b76b9d59f.tar.gz
tester shouldn't fail when copyFile fails anymore
Diffstat (limited to 'tests')
-rw-r--r--tests/specials.nim10
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"