test/tools/javac/unicode/SupplementaryJavaID6.sh

Wed, 06 Apr 2011 20:33:44 -0700

author
ohair
date
Wed, 06 Apr 2011 20:33:44 -0700
changeset 962
0ff2bbd38f10
parent 554
9d9f26857129
child 1223
f3743b82945e
permissions
-rw-r--r--

7033660: Update copyright year to 2011 on any files changed in 2011
Reviewed-by: dholmes

duke@1 1 #!/bin/sh
duke@1 2
duke@1 3 #
ohair@554 4 # Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
duke@1 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 6 #
duke@1 7 # This code is free software; you can redistribute it and/or modify it
duke@1 8 # under the terms of the GNU General Public License version 2 only, as
duke@1 9 # published by the Free Software Foundation.
duke@1 10 #
duke@1 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 # accompanied this code).
duke@1 16 #
duke@1 17 # You should have received a copy of the GNU General Public License version
duke@1 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 #
ohair@554 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 22 # or visit www.oracle.com if you need additional information or have any
ohair@554 23 # questions.
duke@1 24 #
duke@1 25
duke@1 26 #
duke@1 27 # @test
duke@1 28 # @bug 4914724 4973116 5014511
duke@1 29 # @summary Ensure that a supplementary character can be used as part/whole of a class
duke@1 30 # name on platforms that have Unicode aware filesystems.
duke@1 31 # @author Naoto Sato
duke@1 32 # @run shell SupplementaryJavaID6.sh SupplementaryJavaID6
duke@1 33
duke@1 34
duke@1 35 if [ "${TESTSRC}" = "" ]
duke@1 36 then
duke@1 37 echo "TESTSRC not set. Test cannot execute. Failed."
duke@1 38 exit 1
duke@1 39 fi
duke@1 40 echo "TESTSRC=${TESTSRC}"
duke@1 41 if [ "${TESTJAVA}" = "" ]
duke@1 42 then
duke@1 43 echo "TESTJAVA not set. Test cannot execute. Failed."
duke@1 44 exit 1
duke@1 45 fi
duke@1 46 echo "TESTJAVA=${TESTJAVA}"
duke@1 47 if [ "${TESTCLASSES}" = "" ]
duke@1 48 then
duke@1 49 echo "TESTCLASSES not set. Test cannot execute. Failed."
duke@1 50 exit 1
duke@1 51 fi
duke@1 52 echo "TESTCLASSES=${TESTCLASSES}"
duke@1 53 echo "CLASSPATH=${CLASSPATH}"
duke@1 54
duke@1 55 # set platform-dependent variables
duke@1 56 OS=`uname -s`
duke@1 57 case "$OS" in
duke@1 58 SunOS | Linux )
duke@1 59 if [ -d /usr/lib/locale/en_US.UTF-8 -o -d /usr/lib/locale/en_US.utf8 ]
duke@1 60 then
duke@1 61 ENV="env LANG=en_US.UTF-8"
duke@1 62 PS=":"
duke@1 63 FS="/"
duke@1 64 else
duke@1 65 echo "As there is no en_US.UTF-8 locale available on this system, the compilation of the test case may or may not fail. Ignoring this test."
duke@1 66 exit 0;
duke@1 67 fi
duke@1 68 ;;
duke@1 69 Windows_98 | Windows_ME )
duke@1 70 echo "As Windows 98/Me do not provide Unicode-aware file system, the compilation of the test case is expected to fail on these platforms. Ignoring this test."
duke@1 71 exit 0;
duke@1 72 ;;
duke@1 73 Windows* )
duke@1 74 ENV=""
duke@1 75 PS=";"
duke@1 76 FS="\\"
duke@1 77 ;;
jjg@390 78 CYGWIN* )
jjg@390 79 ENV=""
jjg@390 80 PS=";" # platform PS, not cygwin PS
jjg@390 81 FS="/"
jjg@390 82 ;;
duke@1 83 * )
duke@1 84 echo "Unrecognized system!"
duke@1 85 exit 1;
duke@1 86 ;;
duke@1 87 esac
duke@1 88
duke@1 89 # compile
duke@1 90 cp "${TESTSRC}${FS}$1.java" .
duke@1 91 ${ENV} "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . -classpath ".${PS}${TESTSRC}" $1.java
duke@1 92 result=$?
duke@1 93
duke@1 94 if [ $result -ne 0 ]
duke@1 95 then
duke@1 96 echo "Failed"
duke@1 97 exit $result
duke@1 98 fi
duke@1 99
duke@1 100 # run
duke@1 101 ${ENV} "${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} $1
duke@1 102 result=$?
duke@1 103
duke@1 104 if [ $result -eq 0 ]
duke@1 105 then
duke@1 106 echo "Passed"
duke@1 107 else
duke@1 108 echo "Failed"
duke@1 109 fi
duke@1 110
duke@1 111 # Cleanup
duke@1 112 ${ENV} rm -f ./$1*.class
duke@1 113
duke@1 114 exit $result

mercurial