Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/rmi/rmic/newrmic/equivalence/batch.sh
38867 views
#!/bin/sh1#2# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#2324#25# Usage: batch.sh classpath classes...26#2728if [ $# -lt 2 ]29then30echo "Usage: `basename $0` classpath classes..."31exit 132fi3334if [ "${TESTJAVA}" = "" ]35then36echo "TESTJAVA not set. Test cannot execute. Failed."37exit 138fi3940refv11dir=./ref-v1.1-output41refvcompatdir=./ref-vcompat-output42refv12dir=./ref-v1.2-output4344newv11dir=./new-v1.1-output45newvcompatdir=./new-vcompat-output46newv12dir=./new-v1.2-output4748v11diffs=./diffs-v1.149vcompatdiffs=./diffs-vcompat50v12diffs=./diffs-v1.25152difflines=./diff-lines5354rm -rf $refv11dir $refvcompatdir $refv12dir55rm -rf $newv11dir $newvcompatdir $newv12dir56rm -f $v11diffs $vcompatdiffs $v12diffs $difflines5758mkdir $refv11dir $refvcompatdir $refv12dir59mkdir $newv11dir $newvcompatdir $newv12dir6061set -ex6263${TESTJAVA}/bin/rmic -keep -nowrite -v1.1 -d $refv11dir -classpath "$@"64${TESTJAVA}/bin/rmic -keep -nowrite -vcompat -d $refvcompatdir -classpath "$@"65${TESTJAVA}/bin/rmic -keep -nowrite -v1.2 -d $refv12dir -classpath "$@"6667${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -v1.1 -d $newv11dir -classpath "$@"68${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -vcompat -d $newvcompatdir -classpath "$@"69${TESTJAVA}/bin/rmic -Xnew -keep -nowrite -v1.2 -d $newv12dir -classpath "$@"7071set +ex7273diff -r $refv11dir $newv11dir > $v11diffs74diff -r $refvcompatdir $newvcompatdir > $vcompatdiffs75diff -r $refv12dir $newv12dir > $v12diffs7677cat $v11diffs $vcompatdiffs $v12diffs | grep '^[<>O]' | fgrep -v ' server = (' > $difflines7879if [ `cat $difflines | wc -l` -gt 0 ]80then81cat $v11diffs $vcompatdiffs $v12diffs82echo "TEST FAILED: unexpected diffs"83exit 184fi8586echo "TEST PASSED: new rmic output identical to reference rmic output"8788rm -rf $refv11dir $refvcompatdir $refv12dir89rm -rf $newv11dir $newvcompatdir $newv12dir90rm -f $v11diffs $vcompatdiffs $v12diffs $difflines919293