comparison test/runtime/7051189/Xchecksig.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
comparison
equal deleted inserted replaced
8830:7ca101eef24a 8831:04d6d4322c6a
27 # @summary Need to suppress info message if -xcheck:jni used with libjsig.so 27 # @summary Need to suppress info message if -xcheck:jni used with libjsig.so
28 # @run shell Xchecksig.sh 28 # @run shell Xchecksig.sh
29 # 29 #
30 30
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 printf "TESTJAVA not set, selecting " ${TESTJAVA}
40 printf " If this is incorrect, try setting the variable manually.\n"
41 fi
42
43 39
44 OS=`uname -s` 40 OS=`uname -s`
45 case "$OS" in 41 case "$OS" in
46 SunOS | Linux | Darwin )
47 FS="/"
48 ;;
49 Windows_* | CYGWIN_* ) 42 Windows_* | CYGWIN_* )
50 printf "Not testing libjsig.so on Windows. PASSED.\n " 43 printf "Not testing libjsig.so on Windows. PASSED.\n "
51 exit 0 44 exit 0
52 ;; 45 ;;
53 * )
54 printf "Not testing libjsig.so on unrecognised system. PASSED.\n "
55 exit 0
56 ;;
57 esac 46 esac
58
59 47
60 JAVA=${TESTJAVA}${FS}bin${FS}java 48 JAVA=${TESTJAVA}${FS}bin${FS}java
61 49
62 # LD_PRELOAD arch needs to match the binary we run, so run the java 50 # LD_PRELOAD arch needs to match the binary we run, so run the java
63 # 64-bit binary directly if we are testing 64-bit (bin/ARCH/java). 51 # 64-bit binary directly if we are testing 64-bit (bin/ARCH/java).
95 printf "Not testing architecture $ARCH, skipping test.\n" 83 printf "Not testing architecture $ARCH, skipping test.\n"
96 exit 0 84 exit 0
97 ;; 85 ;;
98 esac 86 esac
99 87
100 LIBJSIG=${TESTJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so 88 LIBJSIG=${COMPILEJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so
101 89
102 # If libjsig and binary do not match, skip test. 90 # If libjsig and binary do not match, skip test.
103 91
104 A=`file ${LIBJSIG} | awk '{ print $3 }'` 92 A=`file ${LIBJSIG} | awk '{ print $3 }'`
105 B=`file ${JAVA} | awk '{ print $3 }'` 93 B=`file ${JAVA} | awk '{ print $3 }'`