CompareTest.sh revision 415
10139N/A#!/bin/sh
10139N/A#
10139N/A# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
12198N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10139N/A#
10139N/A# This code is free software; you can redistribute it and/or modify it
10139N/A# under the terms of the GNU General Public License version 2 only, as
17596N/A# published by the Free Software Foundation.
10139N/A#
17180N/A# This code is distributed in the hope that it will be useful, but WITHOUT
17180N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17180N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10139N/A# version 2 for more details (a copy is included in the LICENSE file that
10139N/A# accompanied this code).
10139N/A#
10139N/A# You should have received a copy of the GNU General Public License version
18434N/A# 2 along with this work; if not, write to the Free Software Foundation,
12578N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
10139N/A#
10139N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
10139N/A# CA 95054 USA or visit www.sun.com if you need additional information or
18238N/A# have any questions.
11419N/A#
10139N/A
11419N/Ajdk=${1:-/opt/jdk/1.6.0}
10139N/Ajavah=${jdk}/bin/javah
10142N/Artjar=${jdk}/jre/lib/rt.jar
10142N/A
10244N/A# compile test
14429N/Amkdir -p build/compareTest
14429N/A/opt/jdk/1.7.0/bin/javac -classpath build/classes -d build/compareTest test/tools/javah/compareTest/*.java
12773N/A
14444N/A# run test
12773N/A/opt/jdk/1.7.0/bin/java -classpath build/compareTest:build/classes CompareTest $javah $rtjar 2>&1 | tee CompareTest.out
11419N/A
10139N/A# show diffs for tests that failed
10139N/Agrep 'error:' CompareTest.out | sed -e 's|.*new/||' -e 's/\.h$//' -e 's|_|.|g' > CompareTest.classes.fail
11419N/A
11437N/Afor i in $(cat CompareTest.classes.fail) ; do
11962N/A /opt/jdk/1.7.0/bin/java -classpath compareTest:build/classes CompareTest $javah $rtjar $i
11437N/A diff -r old new
11437N/Adone
10139N/A
10139N/A