comparison test/runtime/6626217/Test6626217.sh @ 8831:04d6d4322c6a

8009152: A number of jtreg tests need review/improvement Summary: Added a new test_env.txt file to capture common shell variable. Added concept of COMPILEJAVA for use when TESTJAVA is a JRE. If COMPILEJAVA not set then TESTJAVA will be the default with assumption it is a JDK. Reviewed-by: kvn, brutisso, coleenp
author collins
date Wed, 27 Mar 2013 09:49:51 -0700
parents 83b6305a5638
children e567d5afd4dd
comparison
equal deleted inserted replaced
8830:7ca101eef24a 8831:04d6d4322c6a
25 # @test @(#)Test6626217.sh 25 # @test @(#)Test6626217.sh
26 # @bug 6626217 26 # @bug 6626217
27 # @summary Loader-constraint table allows arrays instead of only the base-classes 27 # @summary Loader-constraint table allows arrays instead of only the base-classes
28 # @run shell Test6626217.sh 28 # @run shell Test6626217.sh
29 # 29 #
30 30 ## some tests require path to find test source dir
31 if [ "${TESTSRC}" = "" ] 31 if [ "${TESTSRC}" = "" ]
32 then TESTSRC=. 32 then
33 TESTSRC=${PWD}
34 echo "TESTSRC not set. Using "${TESTSRC}" as default"
33 fi 35 fi
34 36 echo "TESTSRC=${TESTSRC}"
35 if [ "${TESTJAVA}" = "" ] 37 ## Adding common setup Variables for running shell tests.
36 then 38 . ${TESTSRC}/../../test_env.sh
37 PARENT=`dirname \`which java\``
38 TESTJAVA=`dirname ${PARENT}`
39 echo "TESTJAVA not set, selecting " ${TESTJAVA}
40 echo "If this is incorrect, try setting the variable manually."
41 fi
42
43 if [ "${TESTCLASSES}" = "" ]
44 then
45 echo "TESTCLASSES not set. Test cannot execute. Failed."
46 exit 1
47 fi
48
49 # set platform-dependent variables
50 OS=`uname -s`
51 case "$OS" in
52 SunOS | Linux | Darwin )
53 NULL=/dev/null
54 PS=":"
55 FS="/"
56 RM=/bin/rm
57 CP=/bin/cp
58 MV=/bin/mv
59 ;;
60 Windows_* )
61 NULL=NUL
62 PS=";"
63 FS="\\"
64 RM=rm
65 CP=cp
66 MV=mv
67 ;;
68 CYGWIN_* )
69 NULL=/dev/null
70 PS=";"
71 FS="/"
72 RM=rm
73 CP=cp
74 MV=mv
75 ;;
76 * )
77 echo "Unrecognized system!"
78 exit 1;
79 ;;
80 esac
81
82 JEMMYPATH=${CPAPPEND}
83 CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
84
85 THIS_DIR=`pwd`
86 39
87 JAVA=${TESTJAVA}${FS}bin${FS}java 40 JAVA=${TESTJAVA}${FS}bin${FS}java
88 JAVAC=${TESTJAVA}${FS}bin${FS}javac 41 JAVAC=${COMPILEJAVA}${FS}bin${FS}javac
89
90 ${JAVA} ${TESTVMOPTS} -version
91 42
92 # Current directory is scratch directory, copy all the test source there 43 # Current directory is scratch directory, copy all the test source there
93 # (for the subsequent moves to work). 44 # (for the subsequent moves to work).
94 ${CP} ${TESTSRC}${FS}* ${THIS_DIR} 45 ${CP} ${TESTSRC}${FS}* ${THIS_DIR}
95 46
96 # A Clean Compile: this line will probably fail within jtreg as have a clean dir: 47 # A Clean Compile: this line will probably fail within jtreg as have a clean dir:
97 ${RM} -f *.class *.impl many_loader.java 48 ${RM} -f *.class *.impl many_loader.java
98 49
99 # Compile all the usual suspects, including the default 'many_loader' 50 # Compile all the usual suspects, including the default 'many_loader'
100 ${CP} many_loader1.java.foo many_loader.java 51 ${CP} many_loader1.java.foo many_loader.java
101 ${JAVAC} -source 1.4 -target 1.4 -Xlint *.java 52 ${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
102 53
103 # Rename the class files, so the custom loader (and not the system loader) will find it 54 # Rename the class files, so the custom loader (and not the system loader) will find it
104 ${MV} from_loader2.class from_loader2.impl2 55 ${MV} from_loader2.class from_loader2.impl2
105 56
106 # Compile the next version of 'many_loader' 57 # Compile the next version of 'many_loader'
107 ${MV} many_loader.class many_loader.impl1 58 ${MV} many_loader.class many_loader.impl1
108 ${CP} many_loader2.java.foo many_loader.java 59 ${CP} many_loader2.java.foo many_loader.java
109 ${JAVAC} -source 1.4 -target 1.4 -Xlint many_loader.java 60 ${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
110 61
111 # Rename the class file, so the custom loader (and not the system loader) will find it 62 # Rename the class file, so the custom loader (and not the system loader) will find it
112 ${MV} many_loader.class many_loader.impl2 63 ${MV} many_loader.class many_loader.impl2
113 ${MV} many_loader.impl1 many_loader.class 64 ${MV} many_loader.impl1 many_loader.class
114 ${RM} many_loader.java 65 ${RM} many_loader.java