8130306: enable running Nashorn test on Windows
authormhaupt
Thu, 02 Jul 2015 11:09:20 +0200
changeset 31491 bba9c22de331
parent 31490 77f783445d40
child 31492 f8c2cc6528ad
8130306: enable running Nashorn test on Windows Summary: fix executable name (add .exe suffix) Reviewed-by: hannesw, sundar
nashorn/test/script/nosecurity/JDK-8050964.js
--- a/nashorn/test/script/nosecurity/JDK-8050964.js	Thu Jul 02 10:55:35 2015 +0200
+++ b/nashorn/test/script/nosecurity/JDK-8050964.js	Thu Jul 02 11:09:20 2015 +0200
@@ -46,10 +46,14 @@
     nashornJar = new File(".", nashornJar);
 }
 
+var os = System.getProperty("os.name"),
+    win = os.startsWith("Windows"),
+    jdepsName = "jdeps" + (win ? ".exe" : "");
+
 var javahome = System.getProperty("java.home");
-var jdepsPath = javahome + "/../bin/jdeps".replace(/\//g, File.separator);
+var jdepsPath = javahome + "/../bin/".replace(/\//g, File.separator) + jdepsName;
 if (! new File(jdepsPath).isFile()) {
-    jdepsPath = javahome + "/bin/jdeps".replace(/\//g, File.separator);
+    jdepsPath = javahome + "/bin/".replace(/\//g, File.separator) + jdepsName;
 }
 
 // run jdep on nashorn.jar - only summary but print profile info