test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh

Print this page




 126    if [ -n "$1" ] ;
 127       then TESTJAVA=$1
 128       else echo "no JDK specified on command line so using default!"
 129      TESTJAVA=$DEFAULT_JDK
 130    fi
 131    TESTSRC=.
 132    TESTCLASSES=.
 133    STANDALONE=1;
 134 fi
 135 echo "JDK under test is: $TESTJAVA"
 136 
 137 #Deal with .class files:
 138 if [ -n "${STANDALONE}" ] ;
 139    then
 140    #if standalone, remind user to cd to dir. containing test before running it
 141    echo "Just a reminder: cd to the dir containing this test when running it"
 142    # then compile all .java files (if there are any) into .class files
 143    if [ -a *.java ] ;
 144       then echo "Reminder, this test should be in its own directory with all"
 145       echo "supporting files it needs in the directory with it."
 146       ${TESTJAVA}/bin/javac ./*.java ;
 147    fi
 148    # else in harness so copy all the class files from where jtreg put them
 149    # over to the scratch directory this test is running in.
 150    else cp ${TESTCLASSES}/*.class . ;
 151 fi
 152 
 153 #if in test harness, then copy the entire directory that the test is in over
 154 # to the scratch directory.  This catches any support files needed by the test.
 155 if [ -z "${STANDALONE}" ] ;
 156    then cp ${TESTSRC}/* .
 157 fi
 158 
 159 #Just before executing anything, make sure it has executable permission!
 160 chmod 777 ./*
 161 
 162 ###############  YOUR TEST CODE HERE!!!!!!!  #############
 163 
 164 #All files required for the test should be in the same directory with
 165 # this file.  If converting a standalone test to run with the harness,
 166 # as long as all files are in the same directory and it returns 0 for
 167 # pass, you should be able to cut and paste it into here and it will
 168 # run with the test harness.
 169 
 170 ${TESTJAVA}/bin/java ShowExitTest
 171 
 172 ###############  END YOUR TEST CODE !!!!! ############
 173 #Be sure the last command executed above this line returns 0 for success,
 174 # something non-zero for failure.
 175 status=$?
 176 
 177 # pass or fail the test based on status of the command
 178 if [ $status -eq "0" ];
 179    then pass ""
 180 
 181    else fail "The program didn't terminate automatically!"
 182 fi
 183 
 184 #For additional examples of how to write platform independent KSH scripts,
 185 # see the jtreg file itself.  It is a KSH script for both Solaris and Win32
 186 


 126    if [ -n "$1" ] ;
 127       then TESTJAVA=$1
 128       else echo "no JDK specified on command line so using default!"
 129      TESTJAVA=$DEFAULT_JDK
 130    fi
 131    TESTSRC=.
 132    TESTCLASSES=.
 133    STANDALONE=1;
 134 fi
 135 echo "JDK under test is: $TESTJAVA"
 136 
 137 #Deal with .class files:
 138 if [ -n "${STANDALONE}" ] ;
 139    then
 140    #if standalone, remind user to cd to dir. containing test before running it
 141    echo "Just a reminder: cd to the dir containing this test when running it"
 142    # then compile all .java files (if there are any) into .class files
 143    if [ -a *.java ] ;
 144       then echo "Reminder, this test should be in its own directory with all"
 145       echo "supporting files it needs in the directory with it."
 146       ${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} ./*.java ;
 147    fi
 148    # else in harness so copy all the class files from where jtreg put them
 149    # over to the scratch directory this test is running in.
 150    else cp ${TESTCLASSES}/*.class . ;
 151 fi
 152 
 153 #if in test harness, then copy the entire directory that the test is in over
 154 # to the scratch directory.  This catches any support files needed by the test.
 155 if [ -z "${STANDALONE}" ] ;
 156    then cp ${TESTSRC}/* .
 157 fi
 158 
 159 #Just before executing anything, make sure it has executable permission!
 160 chmod 777 ./*
 161 
 162 ###############  YOUR TEST CODE HERE!!!!!!!  #############
 163 
 164 #All files required for the test should be in the same directory with
 165 # this file.  If converting a standalone test to run with the harness,
 166 # as long as all files are in the same directory and it returns 0 for
 167 # pass, you should be able to cut and paste it into here and it will
 168 # run with the test harness.
 169 
 170 ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} ShowExitTest
 171 
 172 ###############  END YOUR TEST CODE !!!!! ############
 173 #Be sure the last command executed above this line returns 0 for success,
 174 # something non-zero for failure.
 175 status=$?
 176 
 177 # pass or fail the test based on status of the command
 178 if [ $status -eq "0" ];
 179    then pass ""
 180 
 181    else fail "The program didn't terminate automatically!"
 182 fi
 183 
 184 #For additional examples of how to write platform independent KSH scripts,
 185 # see the jtreg file itself.  It is a KSH script for both Solaris and Win32
 186