comparison test/runtime/6929067/Test6929067.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 e0ea0e94c23c
children f9ee986a9fea
comparison
equal deleted inserted replaced
8830:7ca101eef24a 8831:04d6d4322c6a
5 ## @bug 6929067 5 ## @bug 6929067
6 ## @summary Stack guard pages should be removed when thread is detached 6 ## @summary Stack guard pages should be removed when thread is detached
7 ## @compile T.java 7 ## @compile T.java
8 ## @run shell Test6929067.sh 8 ## @run shell Test6929067.sh
9 ## 9 ##
10 10 set -x
11 if [ "${TESTSRC}" = "" ] 11 if [ "${TESTSRC}" = "" ]
12 then TESTSRC=. 12 then
13 TESTSRC=${PWD}
14 echo "TESTSRC not set. Using "${TESTSRC}" as default"
13 fi 15 fi
14 16 echo "TESTSRC=${TESTSRC}"
15 if [ "${TESTJAVA}" = "" ] 17 ## Adding common setup Variables for running shell tests.
16 then 18 . ${TESTSRC}/../../test_env.sh
17 PARENT=`dirname \`which java\``
18 TESTJAVA=`dirname ${PARENT}`
19 echo "TESTJAVA not set, selecting " ${TESTJAVA}
20 echo "If this is incorrect, try setting the variable manually."
21 fi
22 19
23 # set platform-dependent variables 20 # set platform-dependent variables
24 OS=`uname -s` 21 OS=`uname -s`
25 case "$OS" in 22 case "$OS" in
26 Linux) 23 Linux)
105 then 102 then
106 VMTYPE=server 103 VMTYPE=server
107 fi 104 fi
108 105
109 106
110 LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH 107 LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
111 export LD_LIBRARY_PATH 108 export LD_LIBRARY_PATH
112 109
113 cp ${TESTSRC}${FS}invoke.c . 110 cp ${TESTSRC}${FS}invoke.c .
114 111
115 # Copy the result of our @compile action: 112 # Copy the result of our @compile action:
116 cp ${TESTCLASSES}${FS}T.class . 113 cp ${TESTCLASSES}${FS}T.class .
117 114
118 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion
119
120 echo "Architecture: ${ARCH}" 115 echo "Architecture: ${ARCH}"
121 echo "Compilation flag: ${COMP_FLAG}" 116 echo "Compilation flag: ${COMP_FLAG}"
122 echo "VM type: ${VMTYPE}" 117 echo "VM type: ${VMTYPE}"
118 # Note pthread may not be found thus invoke creation will fail to be created.
119 # Check to ensure you have a /usr/lib/libpthread.so if you don't please look
120 # for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
123 121
124 gcc -DLINUX ${COMP_FLAG} -o invoke \ 122 gcc -DLINUX ${COMP_FLAG} -o invoke \
125 -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ 123 -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
126 -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \ 124 -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \
127 -ljvm -lpthread invoke.c 125 -ljvm -lpthread invoke.c
128 126
129 ./invoke 127 ./invoke
130 exit $? 128 exit $?