6581775: Fix the white space problem in javac shell tests
authorjjg
Mon, 24 Jan 2011 16:34:25 -0800
changeset 8222 28db72eee100
parent 8221 1f0ae42b572e
child 8223 638daa596494
6581775: Fix the white space problem in javac shell tests Reviewed-by: mcimadamore
langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh
langtools/test/tools/javac/ExtDirs/ExtDirs.sh
langtools/test/tools/javac/Paths/Help.sh
langtools/test/tools/javac/javazip/Test.sh
langtools/test/tools/javac/versions/check.sh
--- a/langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh	Mon Jan 24 16:17:33 2011 -0800
+++ b/langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh	Mon Jan 24 16:34:25 2011 -0800
@@ -100,7 +100,7 @@
 	expectedResult="$1"; shift
 	cleanup
 	echo $javac ${TESTTOOLVMOPTS} "$@"
-	$javac ${TESTTOOLVMOPTS} "$@"
+	"$javac" ${TESTTOOLVMOPTS} "$@"
 	report $expectedResult $?
 }
 
--- a/langtools/test/tools/javac/ExtDirs/ExtDirs.sh	Mon Jan 24 16:17:33 2011 -0800
+++ b/langtools/test/tools/javac/ExtDirs/ExtDirs.sh	Mon Jan 24 16:34:25 2011 -0800
@@ -85,15 +85,15 @@
 done
 
 echo "Test 1"
-$javac ${TESTTOOLVMOPTS} -d . -extdirs ext1 "${TESTSRC}${FS}ExtDirTest_1.java"
+"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext1 "${TESTSRC}${FS}ExtDirTest_1.java"
 if [ $? -ne 0 ] ; then fail ; fi
 
 echo "Test 2"
-$javac ${TESTTOOLVMOPTS} -d . -extdirs ext1${PS}ext2 "${TESTSRC}${FS}ExtDirTest_2.java"
+"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext1${PS}ext2 "${TESTSRC}${FS}ExtDirTest_2.java"
 if [ $? -ne 0 ] ; then fail ; fi
 
 echo "Test 3"
-$javac ${TESTTOOLVMOPTS} -d . -extdirs ext3 "${TESTSRC}${FS}ExtDirTest_3.java"
+"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext3 "${TESTSRC}${FS}ExtDirTest_3.java"
 if [ $? -ne 0 ] ; then fail ; fi
 
 echo PASS: all tests gave expected results
--- a/langtools/test/tools/javac/Paths/Help.sh	Mon Jan 24 16:17:33 2011 -0800
+++ b/langtools/test/tools/javac/Paths/Help.sh	Mon Jan 24 16:34:25 2011 -0800
@@ -40,8 +40,8 @@
 
 DiagnosticsInEnglishPlease
 
-HELP="`$javac ${TESTTOOLVMOPTS} -help 2>&1`"
-XHELP="`$javac ${TESTTOOLVMOPTS} -X 2>&1`"
+HELP="`\"$javac\" ${TESTTOOLVMOPTS} -help 2>&1`"
+XHELP="`\"$javac\" ${TESTTOOLVMOPTS} -X 2>&1`"
 
 #----------------------------------------------------------------
 # Standard options
--- a/langtools/test/tools/javac/javazip/Test.sh	Mon Jan 24 16:17:33 2011 -0800
+++ b/langtools/test/tools/javac/javazip/Test.sh	Mon Jan 24 16:34:25 2011 -0800
@@ -66,8 +66,8 @@
     # clean old classes
     rm -f ${TC}${FS}*.class 
 
-    echo "$*"
-    if $* 2>&1 ; then
+    echo "$@"
+    if "$@" 2>&1 ; then
       actual=ok
     else
       actual=err
--- a/langtools/test/tools/javac/versions/check.sh	Mon Jan 24 16:17:33 2011 -0800
+++ b/langtools/test/tools/javac/versions/check.sh	Mon Jan 24 16:34:25 2011 -0800
@@ -32,7 +32,7 @@
 
 J="$TESTJAVA/bin/java" 
 JC="$TESTJAVA/bin/javac" 
-CFV="$J ${TESTVMOPTS} -cp $TC CheckClassFileVersion"
+CFV="${TESTVMOPTS} -cp $TC CheckClassFileVersion"
 
 rm -f $TC/X.java $TC/X.java
 echo 'public class X { }' > $TC/X.java
@@ -44,7 +44,7 @@
 check() {
   V=$1; shift
   echo "+ javac $* [$V]"
-  $JC ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && $CFV $TC/X.class $V || exit 2
+  "$JC" ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && "$J" $CFV $TC/X.class $V || exit 2
 }
 
 check 48.0 -source 1.4
@@ -73,7 +73,7 @@
 
 fail() {
   echo "+ javac $*"
-  if $JC ${TESTTOOLVMOPTS} -d $TC $*; then
+  if "$JC" ${TESTTOOLVMOPTS} -d $TC $*; then
     echo "-- did not fail as expected"
     exit 3
   else
@@ -83,7 +83,7 @@
 
 pass() {
   echo "+ javac $*"
-  if $JC ${TESTTOOLVMOPTS} -d $TC $*; then
+  if "$JC" ${TESTTOOLVMOPTS} -d $TC $*; then
     echo "-- passed"
   else
     echo "-- failed"