test/tools/apt/Basics/print.sh

Sat, 01 Dec 2007 00:00:00 +0000

author
duke
date
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1
9a66ca7c79fa
child 142
e1332c04f6b6
permissions
-rw-r--r--

Initial load

     1 #!/bin/sh
     3 #
     4 # Copyright 2004-2007 Sun Microsystems, Inc.  All Rights Reserved.
     5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6 #
     7 # This code is free software; you can redistribute it and/or modify it
     8 # under the terms of the GNU General Public License version 2 only, as
     9 # published by the Free Software Foundation.
    10 #
    11 # This code is distributed in the hope that it will be useful, but WITHOUT
    12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14 # version 2 for more details (a copy is included in the LICENSE file that
    15 # accompanied this code).
    16 #
    17 # You should have received a copy of the GNU General Public License version
    18 # 2 along with this work; if not, write to the Free Software Foundation,
    19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20 #
    21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
    23 # have any questions.
    24 #
    26 # @test
    27 # @bug 5008759 4998341 5018369 5032476 5060121 5096932 5096931
    28 # @run shell ../verifyVariables.sh
    29 # @build Aggregate
    30 # @run shell print.sh
    31 # @summary test availabilty of print option
    32 # @author Joseph D. Darcy
    34 OS=`uname -s`;
    35 case "${OS}" in
    36         Windows* | CYGWIN* )
    37                 SEP=";"
    38         ;;
    40 	* )
    41 	SEP=":"
    42 	;;
    43 esac
    45 # Construct path to apt executable
    46 APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} \
    47 -print "
    49 printf "%s\n" "APT = ${APT}"
    51 PRINT_FILES="${TESTSRC}/MisMatch.java \
    52 ${TESTSRC}/GenClass.java \
    53 ${TESTSRC}/Misc.java \
    54 ${TESTSRC}/Lacuna.java"
    56 for i in ${PRINT_FILES}
    57 do
    58 	# Delete any existing class file
    59         FILENAME=`basename $i .java`
    60 	rm -f ${FILENAME}.class
    62         printf "%s\n" "Printing ${i}"
    63         ${APT} ${i}
    65         RESULT=$?
    66         case "$RESULT" in
    67                 0  )
    68                 ;;
    70                 * )
    71                 echo "Problem printing file ${i}."
    72                 exit 1
    73         esac
    75         # Verify compilation did not occur
    76 	if [ -f ${FILENAME}.class ]; then
    77 		printf "Improper compilation occured for %s.\n" ${i}
    78 		exit 1
    79 	fi
    81 done
    83 # check for mutliple methods and no static initializer
    85 ${APT} -XclassesAsDecls -cp ${TESTCLASSES} -print Aggregate > aggregate.txt
    86 diff aggregate.txt ${TESTSRC}/goldenAggregate.txt
    88 RESULT=$?
    89 case "$RESULT" in
    90         0  )
    91         ;;
    93         * )
    94         echo "Expected output not received"
    95         exit 1
    96 esac
    98 exit 0

mercurial