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