langtools/test/tools/javah/compareTest/CompareTest.sh
author jwilhelm
Thu, 07 Feb 2013 15:51:25 +0100
changeset 15605 bf7de87bbe3a
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8006432: Ratio flags should be unsigned Summary: Flags changed to be of uintx type Reviewed-by: johnc, tamao
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     1
#!/bin/sh
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     2
#
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
     3
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     5
#
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     8
# published by the Free Software Foundation.
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
     9
#
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    14
# accompanied this code).
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    15
#
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    19
#
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3996
diff changeset
    22
# questions.
3996
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    23
#
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    24
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    25
jdk=${1:-/opt/jdk/1.6.0}
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    26
javah=${jdk}/bin/javah
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    27
rtjar=${jdk}/jre/lib/rt.jar
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    28
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    29
# compile test
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    30
mkdir -p build/compareTest
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    31
/opt/jdk/1.7.0/bin/javac -classpath build/classes -d build/compareTest test/tools/javah/compareTest/*.java
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    32
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    33
# run test
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    34
/opt/jdk/1.7.0/bin/java -classpath build/compareTest:build/classes CompareTest $javah $rtjar 2>&1 | tee CompareTest.out
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    35
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    36
# show diffs for tests that failed
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    37
grep 'error:' CompareTest.out | sed -e 's|.*new/||' -e 's/\.h$//' -e 's|_|.|g' > CompareTest.classes.fail
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    38
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    39
for i in $(cat CompareTest.classes.fail) ; do 
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    40
	/opt/jdk/1.7.0/bin/java -classpath compareTest:build/classes CompareTest $javah $rtjar $i 
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    41
	diff -r old new 
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    42
done 
dc676a9093b3 6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
diff changeset
    43