0N/A#
2362N/A# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#
0N/A
0N/A#!/bin/sh
0N/A#
0N/A# Usage: batch.sh classpath classes...
0N/A#
0N/A
0N/Aif [ $# -lt 2 ]
0N/Athen
0N/A echo "Usage: `basename $0` classpath classes..."
0N/A exit 1
0N/Afi
0N/A
0N/Aif [ "${TESTJAVA}" = "" ]
0N/Athen
0N/A echo "TESTJAVA not set. Test cannot execute. Failed."
0N/A exit 1
0N/Afi
0N/A
0N/Arefv11dir=./ref-v1.1-output
0N/Arefvcompatdir=./ref-vcompat-output
0N/Arefv12dir=./ref-v1.2-output
0N/A
0N/Anewv11dir=./new-v1.1-output
0N/Anewvcompatdir=./new-vcompat-output
0N/Anewv12dir=./new-v1.2-output
0N/A
0N/Av11diffs=./diffs-v1.1
0N/Avcompatdiffs=./diffs-vcompat
0N/Av12diffs=./diffs-v1.2
0N/A
0N/Adifflines=./diff-lines
0N/A
0N/Arm -rf $refv11dir $refvcompatdir $refv12dir
0N/Arm -rf $newv11dir $newvcompatdir $newv12dir
0N/Arm -f $v11diffs $vcompatdiffs $v12diffs $difflines
0N/A
0N/Amkdir $refv11dir $refvcompatdir $refv12dir
0N/Amkdir $newv11dir $newvcompatdir $newv12dir
0N/A
0N/Aset -ex
0N/A
0N/A${TESTJAVA}/bin/rmic -keep -nowrite -v1.1 -d $refv11dir -classpath "$@"
0N/A${TESTJAVA}/bin/rmic -keep -nowrite -vcompat -d $refvcompatdir -classpath "$@"
0N/A${TESTJAVA}/bin/rmic -keep -v1.2 -d $refv12dir -classpath "$@"
0N/A
0N/A${TESTJAVA}/bin/rmic -Xnew -nowrite -keep -v1.1 -d $newv11dir -classpath "$@"
0N/A${TESTJAVA}/bin/rmic -Xnew -nowrite -keep -vcompat -d $newvcompatdir -classpath "$@"
0N/A${TESTJAVA}/bin/rmic -Xnew -keep -v1.2 -d $newv12dir -classpath "$@"
0N/A
0N/Aset +ex
0N/A
0N/Adiff -r $refv11dir $newv11dir > $v11diffs
0N/Adiff -r $refvcompatdir $newvcompatdir > $vcompatdiffs
0N/Adiff -r $refv12dir $newv12dir > $v12diffs
0N/A
0N/Acat $v11diffs $vcompatdiffs $v12diffs | grep '^[<>O]' | fgrep -v ' server = (' > $difflines
0N/A
0N/Aif [ `cat $difflines | wc -l` -gt 0 ]
0N/Athen
0N/A cat $v11diffs $vcompatdiffs $v12diffs
0N/A echo "TEST FAILED: unexpected diffs"
0N/A exit 1
0N/Afi
0N/A
0N/Aecho "TEST PASSED: new rmic output identical to reference rmic output"
0N/A
0N/Arm -rf $refv11dir $refvcompatdir $refv12dir
0N/Arm -rf $newv11dir $newvcompatdir $newv12dir
0N/Arm -f $v11diffs $vcompatdiffs $v12diffs $difflines