Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/runtime/7110720/Test7110720.sh
32284 views
#1# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#456#7# @test Test7110720.sh8# @bug 71107209# @summary improve VM configuration file loading10# @run shell Test7110720.sh11#1213if [ "${TESTSRC}" = "" ]14then15TESTSRC=${PWD}16echo "TESTSRC not set. Using "${TESTSRC}" as default"17fi18echo "TESTSRC=${TESTSRC}"19## Adding common setup Variables for running shell tests.20. ${TESTSRC}/../../test_env.sh2122# Jtreg sets TESTVMOPTS which may include -d64 which is23# required to test a 64-bit JVM on some platforms.24# If another test harness still creates HOME/JDK64BIT,25# we can recognise that.2627# set platform-dependent variables28OS=`uname -s`29case "$OS" in30SunOS | Linux | Darwin )31FS="/"32RM=/bin/rm33CP=/bin/cp34MV=/bin/mv35## for solaris, linux it's HOME36FILE_LOCATION=$HOME37if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]38then39TESTVMOPTS=`cat ${FILE_LOCATION}${FS}JDK64BIT`40fi41;;42Windows_* )43FS="\\"44RM=rm45CP=cp46MV=mv47;;48CYGWIN_* )49FS="/"50RM=rm51CP=cp52MV=mv53;;54* )55echo "Unrecognized system!"56exit 1;57;;58esac596061JAVA=${TESTJAVA}${FS}bin${FS}java6263# Don't test debug builds, they do read the config files:64${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "debug" >/dev/null65if [ "$?" = "0" ]; then66echo Skipping test for debug build.67exit 068fi6970ok=yes7172$RM -f .hotspot_compiler .hotspotrc7374${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null75if [ "$?" = "0" ]; then76echo "FAILED: base case failure"77exit 178fi798081echo "garbage in, garbage out" > .hotspot_compiler82${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null83if [ "$?" = "0" ]; then84echo "FAILED: .hotspot_compiler was read"85ok=no86fi8788$MV .hotspot_compiler hs_comp.txt89${JAVA} ${TESTVMOPTS} -XX:CompileCommandFile=hs_comp.txt -version 2>&1 | grep "garbage in" >/dev/null90if [ "$?" = "1" ]; then91echo "FAILED: explicit compiler command file not read"92ok=no93fi9495$RM -f .hotspot_compiler hs_comp.txt9697echo "garbage" > .hotspotrc98${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage" >/dev/null99if [ "$?" = "0" ]; then100echo "FAILED: .hotspotrc was read"101ok=no102fi103104$MV .hotspotrc hs_flags.txt105${JAVA} ${TESTVMOPTS} -XX:Flags=hs_flags.txt -version 2>&1 | grep "garbage" >/dev/null106if [ "$?" = "1" ]; then107echo "FAILED: explicit flags file not read"108ok=no109fi110111if [ "${ok}" = "no" ]; then112echo "Some tests failed."113exit 1114else115echo "Passed"116exit 0117fi118119120121