test/jdk/sun/rmi/rmic/newrmic/equivalence/batch.sh
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 22602 jdk/test/sun/rmi/rmic/newrmic/equivalence/batch.sh@0d9a07b0d7e9
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17933
b18cda672b79 8014834: shell tests don't begin with #!/bin/sh
emc
parents: 5506
diff changeset
     1
#!/bin/sh
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     3
# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# Usage: batch.sh classpath classes...
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
if [ $# -lt 2 ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
    echo "Usage: `basename $0` classpath classes..."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
if [ "${TESTJAVA}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    echo "TESTJAVA not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
refv11dir=./ref-v1.1-output
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
refvcompatdir=./ref-vcompat-output
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
refv12dir=./ref-v1.2-output
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
newv11dir=./new-v1.1-output
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
newvcompatdir=./new-vcompat-output
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
newv12dir=./new-v1.2-output
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
v11diffs=./diffs-v1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
vcompatdiffs=./diffs-vcompat
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
v12diffs=./diffs-v1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
difflines=./diff-lines
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
rm -rf $refv11dir $refvcompatdir $refv12dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
rm -rf $newv11dir $newvcompatdir $newv12dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
rm -f $v11diffs $vcompatdiffs $v12diffs $difflines
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
mkdir $refv11dir $refvcompatdir $refv12dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
mkdir $newv11dir $newvcompatdir $newv12dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
set -ex
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
22602
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    64
${TESTJAVA}/bin/rmic       -keep -nowrite -v1.1 -d $refv11dir -classpath "$@"
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    65
${TESTJAVA}/bin/rmic       -keep -nowrite -vcompat -d $refvcompatdir -classpath "$@"
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    66
${TESTJAVA}/bin/rmic       -keep -nowrite -v1.2 -d $refv12dir -classpath "$@"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
22602
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    68
${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -v1.1 -d $newv11dir -classpath "$@"
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    69
${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -vcompat -d $newvcompatdir -classpath "$@"
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 17933
diff changeset
    70
${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -v1.2 -d $newv12dir -classpath "$@"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
set +ex
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
diff -r $refv11dir $newv11dir > $v11diffs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
diff -r $refvcompatdir $newvcompatdir > $vcompatdiffs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
diff -r $refv12dir $newv12dir > $v12diffs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
cat $v11diffs $vcompatdiffs $v12diffs | grep '^[<>O]' | fgrep -v ' server = (' > $difflines
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
if [ `cat $difflines | wc -l` -gt 0 ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    cat $v11diffs $vcompatdiffs $v12diffs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    echo "TEST FAILED: unexpected diffs"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
echo "TEST PASSED: new rmic output identical to reference rmic output"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
rm -rf $refv11dir $refvcompatdir $refv12dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
rm -rf $newv11dir $newvcompatdir $newv12dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
rm -f $v11diffs $vcompatdiffs $v12diffs $difflines