diff options
author | Sven Gothel <[email protected]> | 2014-12-11 18:00:25 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-12-11 18:00:25 +0100 |
commit | 150ea4f231c9629ef9ef354e3f1a92a516d46f91 (patch) | |
tree | 518e7172c4b4c76756b03ab87f8cccb87c2f43f2 | |
parent | 9e13e8c78ed69bb7afcd49abe8bf69340dc06223 (diff) |
Bug 1108 - IOUtil.getTempDir(..): Difficulties to determine executable access permission on Windows via BATCH file execution
Try using explicit call to Windows 'cmd.exe' w/ referencing the BATCH file location,
via
'Runtime.getRuntime().exec(new String[] { "cmd", "/c", "a.bat" } );'
While the bug itself could not be reproduced here,
I could test on Windows 7 (64bit and 32bit), as well as an WindowsXP 32bit
that no regression occured.
-rwxr-xr-x | make/scripts/runtest-x32.bat | 4 | ||||
-rwxr-xr-x | make/scripts/runtest-x64.bat | 4 | ||||
-rwxr-xr-x | make/scripts/runtest.sh | 14 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/IOUtil.java | 10 |
4 files changed, 19 insertions, 13 deletions
diff --git a/make/scripts/runtest-x32.bat b/make/scripts/runtest-x32.bat index 749e769..d532ff6 100755 --- a/make/scripts/runtest-x32.bat +++ b/make/scripts/runtest-x32.bat @@ -1,4 +1,4 @@ -REM scripts\java-win32.bat com.jogamp.common.GlueGenVersion +scripts\java-win32.bat com.jogamp.common.GlueGenVersion REM scripts\java-win32.bat com.jogamp.common.util.TestVersionInfo REM scripts\java-win32.bat com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter REM scripts\java-win32.bat com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter @@ -6,5 +6,5 @@ REM scripts\java-win32.bat com.jogamp.common.util.TestTempJarCache REM scripts\java-win32.bat com.jogamp.common.os.TestElfReader01 REM scripts\java-win32.bat com.jogamp.common.util.TestIOUtilURIHandling REM scripts\java-win32.bat com.jogamp.common.nio.TestByteBufferInputStream -scripts\java-win32.bat com.jogamp.common.nio.TestByteBufferOutputStream +REM scripts\java-win32.bat com.jogamp.common.nio.TestByteBufferOutputStream diff --git a/make/scripts/runtest-x64.bat b/make/scripts/runtest-x64.bat index 3c19998..769ee84 100755 --- a/make/scripts/runtest-x64.bat +++ b/make/scripts/runtest-x64.bat @@ -1,4 +1,4 @@ -REM scripts\java-win64.bat com.jogamp.common.GlueGenVersion +scripts\java-win64.bat com.jogamp.common.GlueGenVersion REM scripts\java-win64.bat com.jogamp.common.util.TestVersionInfo REM scripts\java-win64.bat com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter REM scripts\java-win64.bat com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter @@ -15,4 +15,4 @@ REM scripts\java-win64.bat com.jogamp.common.net.TestUri03Resolving REM scripts\java-win64.bat com.jogamp.common.net.TestUri99LaunchOnReservedCharPathBug908 REM scripts\java-win64.bat com.jogamp.common.nio.TestByteBufferInputStream -scripts\java-win64.bat com.jogamp.common.nio.TestByteBufferOutputStream +REM scripts\java-win64.bat com.jogamp.common.nio.TestByteBufferOutputStream diff --git a/make/scripts/runtest.sh b/make/scripts/runtest.sh index d19e016..d44688a 100755 --- a/make/scripts/runtest.sh +++ b/make/scripts/runtest.sh @@ -81,7 +81,7 @@ function onetest() { echo } # -#onetest com.jogamp.common.GlueGenVersion 2>&1 | tee -a $LOG +onetest com.jogamp.common.GlueGenVersion 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestSystemPropsAndEnvs 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestVersionInfo 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestVersionNumber 2>&1 | tee -a $LOG @@ -106,13 +106,11 @@ function onetest() { #onetest com.jogamp.common.util.TestValueConversion 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestSyncRingBuffer01 $* #onetest com.jogamp.common.util.TestLFRingBuffer01 $* - -onetest com.jogamp.common.util.TestBitstream00 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream01 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream02 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream03 2>&1 | tee -a $LOG -onetest com.jogamp.common.util.TestBitstream04 2>&1 | tee -a $LOG - +#onetest com.jogamp.common.util.TestBitstream00 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream01 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream02 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream03 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestBitstream04 2>&1 | tee -a $LOG #onetest com.jogamp.common.net.TestUrisWithAssetHandler 2>&1 | tee -a $LOG #onetest com.jogamp.common.net.TestUriQueryProps 2>&1 | tee -a $LOG #onetest com.jogamp.common.net.TestUri01 2>&1 | tee -a $LOG diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java index 5f3ae01..ac011af 100644 --- a/src/java/com/jogamp/common/util/IOUtil.java +++ b/src/java/com/jogamp/common/util/IOUtil.java @@ -668,6 +668,14 @@ public class IOUtil { return null; } } + private static String[] getShellCommandArgs(final String scriptFile) { + switch(PlatformPropsImpl.OS_TYPE) { + case WINDOWS: + return new String[] { "cmd", "/c", scriptFile }; + default: + return new String[] { scriptFile }; + } + } private static boolean getOSHasNoexecFS() { switch(PlatformPropsImpl.OS_TYPE) { @@ -823,7 +831,7 @@ public class IOUtil { } // Using 'Process.exec(String[])' avoids StringTokenizer of 'Process.exec(String)' // and hence splitting up command by spaces! - final Process pr = Runtime.getRuntime().exec(new String[] { exetst.getCanonicalPath() } ); + final Process pr = Runtime.getRuntime().exec( getShellCommandArgs( exetst.getCanonicalPath() ) ); /** * Disable StreamMonitor, which throttles exec-test performance a lot! * |