1 # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
 2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 3 #
 4 # This code is free software; you can redistribute it and/or modify it
 5 # under the terms of the GNU General Public License version 2 only, as
 6 # published by the Free Software Foundation.
 7 #
 8 # This code is distributed in the hope that it will be useful, but WITHOUT
 9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11 # version 2 for more details (a copy is included in the LICENSE file that
12 # accompanied this code).
13 #
14 # You should have received a copy of the GNU General Public License version
15 # 2 along with this work; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 #
18 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 # or visit www.oracle.com if you need additional information or have any
20 # questions.
21 
22 
23 
24 # build-for-jtreg.sh --
25 #
26 # This script builds the binaries needed by the tests under ../../runtime/cds/appcds/applications/
27 # It also prints out the arguments to be added to the jtreg command-line
28 
29 # Edit the following according to your local setting, or pass them in like this
30 #
31 # env BLDJDK_HOME=/my/java/home ROOT=/my/repo MVN=${HOME}/bin/maven/apache-maven-3.8.8/bin/mvn bash build-for-jtreg.sh
32 #
33 if test "$BLDJDK_HOME" = ""; then
34     # you need JDK 21
35     BLDJDK_HOME=/jdk3/official/jdk21
36 fi
37 
38 if test "$ROOT" = ""; then
39     # This is your copy of https://github.com/openjdk/leyden/tree/premain
40     ROOT=/jdk3/le4/open
41 fi
42 
43 # MVN should point to the mvn executable. You need at least 3.8.2
44 # If MVN is not specified, we will use the mvn installed in your $PATH
45 if test "$MVN" != ""; then
46     MVNARG="MVN=$MVN"
47 else
48     MVNARG=
49 fi
50 
51 cd $ROOT/test/hotspot/jtreg/premain
52 for i in helidon-quickstart-se micronaut-first-app quarkus-getting-started spring-petclinic; do
53     (cd $i; make app BLDJDK_HOME=${BLDJDK_HOME} ${MVNARG}) || exit 1
54 done
55 
56 PM=$ROOT/test/hotspot/jtreg/premain
57 echo Add the following to your jtreg command-line
58 echo "  -vmoption:-Djdk.test.lib.artifacts.helidon-quickstart-se=$PM/helidon-quickstart-se/helidon-quickstart-se \\"
59 echo "  -vmoption:-Djdk.test.lib.artifacts.micronaut-first-app=$PM/micronaut-first-app/download/target \\" 
60 echo "  -vmoption:-Djdk.test.lib.artifacts.quarkus-getting-started=$PM/quarkus-getting-started/getting-started/target \\"
61 echo "  -vmoption:-Djdk.test.lib.artifacts.spring-petclinic=$PM/spring-petclinic/petclinic-snapshot/target/spring-petclinic-3.2.0.zip \\"
62 
63 exit
64 
65 ===============================================================================
66 This is how Ioi executes the tests:
67 
68 env JAVA_HOME=/jdk3/official/jdk22 \
69     /jdk3/official/jtreg7.3.1/bin/jtreg \
70     -J-Djavatest.maxOutputSize=10000000 \
71     -conc:1 \
72     -testjdk:/jdk3/bld/le4-fastdebug/images/jdk \
73     -compilejdk:/jdk3/bld/le4/images/jdk \
74     -verbose:2 \
75     -timeout:4.0 \
76     -agentvm \
77     -vmoptions:-XX:MaxRAMPercentage=6 \
78     -noreport \
79     -vmoption:-Djdk.test.lib.artifacts.helidon-quickstart-se=/jdk3/le4/open/test/hotspot/jtreg/premain/helidon-quickstart-se/helidon-quickstart-se \
80     -vmoption:-Djdk.test.lib.artifacts.micronaut-first-app=/jdk3/le4/open/test/hotspot/jtreg/premain/micronaut-first-app/download/target \
81     -vmoption:-Djdk.test.lib.artifacts.quarkus-getting-started=/jdk3/le4/open/test/hotspot/jtreg/premain/quarkus-getting-started/getting-started/target \
82     -vmoption:-Djdk.test.lib.artifacts.spring-petclinic=/jdk3/le4/open/test/hotspot/jtreg/premain/spring-petclinic/petclinic-snapshot/target/spring-petclinic-3.2.0.zip \
83     -w /home/iklam/tmp/jtreg/work \
84     HelidonQuickStartSE.java#static \
85     MicronautFirstApp.java#static \
86     QuarkusGettingStarted.java#static \
87     spring-petclinic/SpringPetClinicStatic.java