test/tools/javac/unicode/SupplementaryJavaID6.sh

Sat, 01 Dec 2007 00:00:00 +0000

author
duke
date
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1
9a66ca7c79fa
child 390
f0c9fc46990b
permissions
-rw-r--r--

Initial load

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

mercurial