langtools/test/tools/apt/Compile/compile.sh
author darcy
Sun, 26 Jul 2009 21:27:11 -0700
changeset 3378 22011d9a9398
parent 1652 1324f96f3883
child 3769 5fd6cfd5a9a0
permissions -rw-r--r--
6381698: Warn of decommissioning of apt Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
#!/bin/sh
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
#
1652
1324f96f3883 6785258: Update copyright year
xdono
parents: 1483
diff changeset
     4
# Copyright 2004-2008 Sun Microsystems, Inc.  All Rights Reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
#
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
# published by the Free Software Foundation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
# have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
# @test
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
# @bug 5033855 4990902 5023880 5043516 5048534 5048535 5041279 5048539 5067261 5068145 5023881 4996963 5095716 6191667 6433634
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
# @run shell ../verifyVariables.sh
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
# @build ErrorAPF
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
# @build WarnAPF
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
# @build StaticApf
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
# @build ClassDeclApf
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
# @build ClassDeclApf2
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
# @build Rounds
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
# @build Round1Apf Round2Apf Round3Apf Round4Apf
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
# @build WrappedStaticApf
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
# @run shell compile.sh
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
# @summary Test simple usages of apt, including delegating to javac
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
# @author Joseph D. Darcy
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
# If the file *does* exist, exit with an error
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
TestNoFile() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
        if [ -f ${1} ]; then
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
                printf "%s\n" "File ${1} found."
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
                exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
        fi
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
# If the file does not exist, exit with an error
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
TestFile() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
        if [ ! -f ${1} ]; then
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
                printf "%s\n" "File ${1} not found."
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
                exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
        fi
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
OS=`uname -s`;
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
case "${OS}" in
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
        Windows* | CYGWIN* )
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
                SEP=";"
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        SEP=":"
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
3378
22011d9a9398 6381698: Warn of decommissioning of apt
darcy
parents: 1652
diff changeset
    70
APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} -XDsuppress-tool-api-removal-message "
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
JAVA="${TESTJAVA}/bin/java ${TESTVMOPTS} "
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
JAVAC="${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} "
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
unset CLASSPATH
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
echo "Verify that source 1.6 is not supported
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
rm -f HelloWorld.class
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
printf "%s\n" "-source 1.6"     > options0
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
printf "%s\n" "${TESTSRC}/HelloWorld.java"  >> options0
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
${APT} @options0
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
        echo "FAILED: accepted source 1.6"
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
	exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
TestNoFile "HelloWorld.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
echo "Verify that target 1.6 is not supported
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
rm -f HelloWorld.class
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
printf "%s\n" "-target 1.6"     > options00
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
printf "%s\n" "${TESTSRC}/HelloWorld.java"  >> options00
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
${APT} @options00
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        echo "FAILED: accepted target 1.6"
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
	exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
TestNoFile "HelloWorld.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
echo "Testing javac pass-through with -A in options file"
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
rm -f HelloWorld.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
printf "%s\n" "-A"     > options1
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
printf "%s\n" "-d ."     >> options1
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
printf "%s\n" "${TESTSRC}/HelloWorld.java"  >> options1
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
${APT} @options1
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        echo "FAILED: javac with -A in options file did not compile"
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
TestFile "HelloWorld.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
echo "Verifying reporting an error will prevent compilation"
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
rm -f HelloWorld.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
if [ ! -f HelloWorld.java ]; then
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
	cp ${TESTSRC}/HelloWorld.java .
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
fi
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
printf "%s\n" "-factory ErrorAPF"            > options2
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
printf "%s\n" "-d ."                        >> options2
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
printf "%s\n" "-cp ${TESTCLASSES}"          >> options2
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
printf "%s\n" "HelloWorld.java"             >> options2
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
${APT} @options2 2> output
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
TestNoFile "HelloWorld.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
diff output ${TESTSRC}/golden.txt
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        echo "FAILED: did not record expected error messages"
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
echo "Verifying reporting a warning *won't* prevent compilation"
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
rm -f HelloAnnotation.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
if [ ! -f HelloAnnotation.java ]; then
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
	cp ${TESTSRC}/HelloAnnotation.java .
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
fi
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
printf "%s\n" "-factory WarnAPF"             > options3
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
printf "%s\n" "-d ."                        >> options3
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
printf "%s\n" "-cp ${TESTCLASSES}"          >> options3
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
printf "%s\n" "HelloAnnotation.java"        >> options3
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
${APT} @options3 2> output
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
diff output ${TESTSRC}/goldenWarn.txt
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        echo "FAILED: did not record expected warning messages"
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
TestFile "HelloAnnotation.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
echo "Verifying static state is available across apt rounds; -factory, -cp"
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
mkdir -p ./src
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
mkdir -p ./class
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
printf "%s\n" "-factory StaticApf"           > options4
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
printf "%s\n" "-s ./src"                    >> options4
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
printf "%s\n" "-d ./class"                  >> options4
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
printf "%s\n" "-cp ${TESTCLASSES}"          >> options4
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
# printf "%s\n" "-XPrintAptRounds"            >> options4
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
${APT} @options4
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
echo "Verifying static state is available across apt rounds; -factory, -factorypath"
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
printf "%s\n" "-factory StaticApf"           > options5
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
printf "%s\n" "-s ./src"                    >> options5
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
printf "%s\n" "-d ./class"                  >> options5
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
printf "%s\n" "-factorypath ${TESTCLASSES}" >> options5
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
# printf "%s\n" "-XPrintAptRounds"          >> options5
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
${APT} @options5
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
# Create jar file for StaticApf
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
JAR="${TESTJAVA}/bin/jar "
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
mkdir -p META-INF/services
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
cp ${TESTSRC}/servicesStaticApf META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
cp ${TESTCLASSES}/StaticApf*.class .
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
${JAR} cf0 staticApf.jar StaticApf*.class META-INF
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
echo "Verifying static state is available across apt rounds; -cp"
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
printf "%s\n" "-cp staticApf.jar"           > options6
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
printf "%s\n" "-s ./src"                    >> options6
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
printf "%s\n" "-d ./class"                  >> options6
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
printf "%s\n" "-XPrintAptRounds"          >> options6
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
${APT} @options6
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
echo "Verifying static state is available across apt rounds; -factorypath"
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
printf "%s\n" "-factorypath staticApf.jar"   > options7
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
printf "%s\n" "-s ./src"                    >> options7
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
printf "%s\n" "-d ./class"                  >> options7
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
printf "%s\n" "-XPrintAptRounds"            >> options7
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
${APT} @options7
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
echo "Verifying -XclassesAsDecls handles class files properly"
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
mkdir -p ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
${JAVAC} -d ./tmp/classes ${TESTSRC}/src/Round1Class.java ${TESTSRC}/src/AhOneClass.java ${TESTSRC}/src/AndAhTwoClass.java
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
        echo "FAILED: javac failed to succesfully compile."
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
printf "%s\n" "-factorypath ${TESTCLASSES}"  > options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
printf "%s\n" "-factory ClassDeclApf"       >> options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
printf "%s\n" "-s ./src"                    >> options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
printf "%s\n" "-d ./class"                  >> options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
printf "%s\n" "-XPrintAptRounds"            >> options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
printf "%s\n" "-XclassesAsDecls"            >> options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
${APT} @options7a
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
TestFile "./class/AndAhTwoClass.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
echo "Verifying -XclassesAsDecls works with command-line arguments"
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
rm -Rf ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
mkdir -p ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
${JAVAC} -d ./tmp/classes ${TESTSRC}/src/Round1Class.java ${TESTSRC}/src/AndAhTwoClass.java
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
        echo "FAILED: javac failed to succesfully compile."
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
printf "%s\n" "-factorypath ${TESTCLASSES}"  > options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
printf "%s\n" "-factory ClassDeclApf2"       >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
printf "%s\n" "-XPrintAptRounds"            >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
printf "%s\n" "-XclassesAsDecls"            >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
printf "%s\n" "-cp ${TESTCLASSES}"          >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
printf "%s\n" "ErrorAPF"                    >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
printf "%s\n" "WarnAPF"                     >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
printf "%s\n" "-s ./src"                    >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
printf "%s\n" "-d ./class"                  >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
printf "%s\n" "ClassDeclApf"                >> options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
${APT} @options7b
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
        echo "FAILED: apt exited with an error code."
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
TestFile "./class/AndAhTwoClass.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
TestFile "./class/AhOne.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
echo "Verifying -XclassesAsDecls works with all source files"
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
rm -Rf ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
mkdir -p ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
${JAVAC} -d ./tmp/classes ${TESTSRC}/src/Round1Class.java ${TESTSRC}/src/AndAhTwoClass.java
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
        echo "FAILED: javac failed to succesfully compile."
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
printf "%s\n" "-factorypath ${TESTCLASSES}"      > options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
printf "%s\n" "-factory ClassDeclApf2"          >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
printf "%s\n" "-s ./src"                        >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
printf "%s\n" "-d ./class"                      >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
printf "%s\n" "-sourcepath ${TESTSRC}"          >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
printf "%s\n" "${TESTSRC}/HelloAnnotation.java" >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
printf "%s\n" "${TESTSRC}/HelloWorld.java"      >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
printf "%s\n" "${TESTSRC}/Dummy1.java"          >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
printf "%s\n" "-XPrintAptRounds"                >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
printf "%s\n" "-XclassesAsDecls"                >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
printf "%s\n" "-cp ${TESTCLASSES}"              >> options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
${APT} @options7c
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
        echo "FAILED: apt exited with an error code."
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
TestFile "./class/AndAhTwoClass.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
TestFile "./class/AhOne.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
TestFile "./class/HelloWorld.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
echo "Verifying -XclassesAsDecls works with mixed class and source files"
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
rm -Rf ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
mkdir -p ./tmp/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
${JAVAC} -d ./tmp/classes ${TESTSRC}/src/Round1Class.java ${TESTSRC}/src/AndAhTwoClass.java
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
        echo "FAILED: javac failed to succesfully compile."
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
printf "%s\n" "-factorypath ${TESTCLASSES}"  > options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
printf "%s\n" "-factory ClassDeclApf2"      >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
printf "%s\n" "-s ./src"                    >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
printf "%s\n" "-XclassesAsDecls"            >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
printf "%s\n" "ClassDeclApf"                >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
printf "%s\n" "-d ./class"                  >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
printf "%s\n" "ErrorAPF"                    >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
printf "%s\n" "-XPrintAptRounds"            >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
printf "%s\n" "${TESTSRC}/HelloWorld.java"  >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
printf "%s\n" "-cp ${TESTCLASSES}"          >> options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
${APT} @options7d
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
        echo "FAILED: apt exited with an error code."
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
TestFile "./class/AndAhTwoClass.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
TestFile "./class/AhOne.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
TestFile "./class/HelloWorld.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
echo "Testing productive factories are called on subsequent rounds"
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
rm -Rf META-INF/services/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
cp ${TESTSRC}/servicesRound1 META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
cp ${TESTCLASSES}/Round1Apf*.class .
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
${JAR} cf0 round1Apf.jar Round1Apf*.class META-INF
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
rm -Rf META-INF/services/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
cp ${TESTSRC}/servicesRound2 META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
cp ${TESTCLASSES}/Round2Apf*.class .
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
${JAR} cf0 round2Apf.jar Round2Apf*.class META-INF
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
rm -Rf META-INF/services/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
cp ${TESTSRC}/servicesRound3 META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
cp ${TESTCLASSES}/Round3Apf*.class .
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
${JAR} cf0 round3Apf.jar Round3Apf*.class META-INF
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
rm -Rf META-INF/services/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
cp ${TESTSRC}/servicesRound4 META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
cp ${TESTCLASSES}/Round4Apf*.class .
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
${JAR} cf0 round4Apf.jar Round4Apf*.class META-INF
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
cp ${TESTCLASSES}/Round?.class .
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
${JAR} cf0 rounds.jar Round?.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
1483
2540545cd060 6760805: empty element on bootclasspath breaks test/tools/apt/Compile/compile.sh
jjg
parents: 10
diff changeset
   476
# cleanup file to prevent accidental discovery in current directory
2540545cd060 6760805: empty element on bootclasspath breaks test/tools/apt/Compile/compile.sh
jjg
parents: 10
diff changeset
   477
rm -Rf META-INF/services/*
2540545cd060 6760805: empty element on bootclasspath breaks test/tools/apt/Compile/compile.sh
jjg
parents: 10
diff changeset
   478
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
printf "%s\n" "-factorypath round1Apf.jar${SEP}round2Apf.jar${SEP}round3Apf.jar${SEP}round4Apf.jar"   > options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
printf "%s\n" "-classpath rounds.jar"  >> options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
printf "%s\n" "-s ./src"               >> options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
printf "%s\n" "-d ./class"             >> options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
#printf "%s\n" "-XPrintFactoryInfo"     >> options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
#printf "%s\n" "-XPrintAptRounds"       >> options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
printf "%s\n" "${TESTSRC}/Dummy1.java" >> options8
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
${APT} @options8 > multiRoundOutput 2> multiRoundError
06bc494ca11e Initial load
duke
parents:
diff changeset
   487
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
diff multiRoundOutput  ${TESTSRC}/goldenFactory.txt
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
RESULT=$?
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
case "$RESULT" in
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
	0  )
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
        ;;
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
        * )
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
        echo "FAILED: unexpected factory state"
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
        exit 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
esac
06bc494ca11e Initial load
duke
parents:
diff changeset
   499
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
TestFile "./class/Dummy5.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
# ---------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
echo "Verifying static state with programmatic apt entry; no factory options"
06bc494ca11e Initial load
duke
parents:
diff changeset
   505
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   506
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
${JAVA} -cp ${TESTJAVA}/lib/tools.jar${SEP}${TESTCLASSES} WrappedStaticApf -s ./src -d ./class -XPrintAptRounds
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
echo "Verifying static state with programmatic apt entry; -factory"
06bc494ca11e Initial load
duke
parents:
diff changeset
   511
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
${JAVA} -cp ${TESTJAVA}/lib/tools.jar${SEP}${TESTCLASSES} WrappedStaticApf -factory ErrorAPF -s ./src -d ./class -XPrintAptRounds
06bc494ca11e Initial load
duke
parents:
diff changeset
   514
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
echo "Verifying static state with programmatic apt entry; -factorypath"
06bc494ca11e Initial load
duke
parents:
diff changeset
   517
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   518
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
${JAVA} -cp ${TESTJAVA}/lib/tools.jar${SEP}${TESTCLASSES} WrappedStaticApf -factorypath round1Apf.jar -s ./src -d ./class -XPrintAptRounds
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
echo "Verifying static state with programmatic apt entry; -factory and -factorypath"
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
rm -Rf ./src/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
rm -Rf ./class/*
06bc494ca11e Initial load
duke
parents:
diff changeset
   525
${JAVA} -cp ${TESTJAVA}/lib/tools.jar${SEP}${TESTCLASSES} WrappedStaticApf -factorypath round1Apf.jar -factory Round1Apf -s ./src -d ./class -XPrintAptRounds
06bc494ca11e Initial load
duke
parents:
diff changeset
   526
TestFile "./class/AndAhTwo.class"
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
exit 0