test/tools/apt/Basics/print.sh

Mon, 15 Dec 2008 16:55:33 -0800

author
xdono
date
Mon, 15 Dec 2008 16:55:33 -0800
changeset 174
fdfed22db054
parent 142
e1332c04f6b6
child 387
f29068bfeaed
permissions
-rw-r--r--

6785258: Update copyright year
Summary: Update copyright for files that have been modified starting July 2008 to Dec 2008
Reviewed-by: katleman, ohair, tbell

     1 #!/bin/sh
     3 #
     4 # Copyright 2004-2008 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 # @run shell print.sh
    30 # @summary test availabilty of print option
    31 # @author Joseph D. Darcy
    33 OS=`uname -s`;
    34 case "${OS}" in
    35         Windows* | CYGWIN* )
    36                 SEP=";"
    37         ;;
    39 	* )
    40 	SEP=":"
    41 	;;
    42 esac
    44 # Compile file directly, without TESTJAVACOPTS
    45 # Don't use @build or @compile as these implicitly use jtreg -javacoption values
    46 # and it is important that this file be compiled as expected, for later comparison
    47 # against a golden file.
    48 "${TESTJAVA}/bin/javac" ${TESTTOOLVMOPTS} -d ${TESTCLASSES} ${TESTSRC}/Aggregate.java
    50 # Construct path to apt executable
    51 APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} \
    52 -print "
    54 printf "%s\n" "APT = ${APT}"
    56 PRINT_FILES="${TESTSRC}/MisMatch.java \
    57 ${TESTSRC}/GenClass.java \
    58 ${TESTSRC}/Misc.java \
    59 ${TESTSRC}/Lacuna.java"
    61 for i in ${PRINT_FILES}
    62 do
    63 	# Delete any existing class file
    64         FILENAME=`basename $i .java`
    65 	rm -f ${FILENAME}.class
    67         printf "%s\n" "Printing ${i}"
    68         ${APT} ${i}
    70         RESULT=$?
    71         case "$RESULT" in
    72                 0  )
    73                 ;;
    75                 * )
    76                 echo "Problem printing file ${i}."
    77                 exit 1
    78         esac
    80         # Verify compilation did not occur
    81 	if [ -f ${FILENAME}.class ]; then
    82 		printf "Improper compilation occured for %s.\n" ${i}
    83 		exit 1
    84 	fi
    86 done
    88 # check for mutliple methods and no static initializer
    90 ${APT} -XclassesAsDecls -cp ${TESTCLASSES} -print Aggregate > aggregate.txt
    91 diff aggregate.txt ${TESTSRC}/goldenAggregate.txt
    93 RESULT=$?
    94 case "$RESULT" in
    95         0  )
    96         ;;
    98         * )
    99         echo "Expected output not received"
   100         exit 1
   101 esac
   103 exit 0

mercurial