comparison tck7/run_all.sh @ 18:a75e3cbf5b1c draft

Added script used to run TCK7.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Tue, 22 Apr 2014 13:35:48 +0200
parents
children d8557576f53a
comparison
equal deleted inserted replaced
17:4320e01c478a 18:a75e3cbf5b1c
1 #!/usr/bin/env bash
2
3 # Daily test builder.
4 #
5 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Red Hat
6 #
7 # This tool is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This tool is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with IcedTea; see the file COPYING. If not, write to the
19 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # 02110-1301 USA.
21 #
22 # Linking this library statically or dynamically with other modules is
23 # making a combined work based on this library. Thus, the terms and
24 # conditions of the GNU General Public License cover the whole
25 # combination.
26 #
27 # As a special exception, the copyright holders of this library give you
28 # permission to link this library with independent modules to produce an
29 # executable, regardless of the license terms of these independent
30 # modules, and to copy and distribute the resulting executable under
31 # terms of your choice, provided that you also meet, for each linked
32 # independent module, the terms and conditions of the license of that
33 # module. An independent module is a module which is not derived from
34 # or based on this library. If you modify this library, you may extend
35 # this exception to your version of the library, but you are not
36 # obligated to do so. If you do not wish to do so, delete this
37 # exception statement from your version.
38 #
39 # Run TCK against all tested JDKs.
40 #
41 # Author: Pavel Tisnovsky
42 # e-mail: ptisnovs@redhat.com
43
44 JCK_ROOT_DIR=`cat jck.dir`
45 JCK_VERSION=7
46 JCK_DIR=${JCK_ROOT_DIR}/${JCK_VERSION}
47 WORK_DIR=${JCK_ROOT_DIR}/work
48 RESULT_DIR=${JCK_ROOT_DIR}/results
49 DAILY_TESTS_DIR=`cat dailytests.dir`
50
51 DATE=`date +%Y%m%d`
52
53 exec > logs/test_$DATE.log 2>&1
54
55 TESTS="compiler devtools runtime"
56
57 function run_tck()
58 {
59 echo "Run tck $1"
60 REPORTDIR=${RESULT_DIR}/${DATE}-${1}
61 export DISPLAY=:0.0
62
63 for tst in ${TESTS}
64 do
65 TEST_NAME=JCK-${tst}-${JCK_VERSION}
66 CURRENT_WORKDIR=${WORK_DIR}/${DATE}-${1}/${tst}
67 CONFIG=${JCK_DIR}/${tst}-config.jti
68
69 mkdir -p ${REPORTDIR}/${tst}
70 mkdir -p ${CURRENT_WORKDIR}
71
72 ORIG_PATH="${PATH}"
73 export PATH="${JCK_DIR}/${TEST_NAME}/linux/bin;${ORIG_PATH}"
74
75 java -Xms128m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=512m -jar ${JCK_DIR}/${TEST_NAME}/lib/javatest.jar \
76 -workdir ${CURRENT_WORKDIR} \
77 -open ${CONFIG} \
78 -verbose:progress -runtests \
79 -writeReport ${REPORTDIR}/${tst}
80 rc=$?
81 if [ $rc -ne 0 ]; then
82 log "${RED}test failed ${BLUE}${tst}${RESET}"
83 else
84 log "${GREEN}test passed ${BLUE}${tst}${RESET}"
85 fi
86
87 export PATH="${ORIG_PATH}"
88 done
89 }
90
91 function finish_tck()
92 {
93 echo "Finish tck $1"
94 REPORTDIR=${RESULT_DIR}/${DATE}-${1}
95 export DISPLAY=:0.0
96 echo "Processing ${REPORTDIR}"
97 for tst in ${TESTS}
98 do
99 TEST_NAME=JCK-${tst}-${JCK_VERSION}
100 CURRENT_WORKDIR=${WORK_DIR}/${DATE}-${1}/${tst}
101 CONFIG=${JCK_DIR}/${tst}-config.jti
102
103 java -Xms128m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=512m -jar ${JCK_DIR}/${TEST_NAME}/lib/javatest.jar \
104 -workDir ${CURRENT_WORKDIR} \
105 -config ${CONFIG} \
106 -verbose:progress \
107 -priorStatus passed,fail,error \
108 -writeReport ${REPORTDIR}/${tst}
109 done
110 }
111
112 function run_tck1()
113 {
114 rm ${JCK_DIR}/jdk
115 ln -s -T ${DAILY_TESTS_DIR}/builds/Icedtea7_forest/openjdk/build/linux-amd64/j2sdk-image/ ${JCK_DIR}/jdk
116 ls -l ${JCK_DIR}/
117
118 run_tck 1
119 sleep 10
120 finish_tck 1
121 }
122
123 function run_tck2()
124 {
125 rm ${JCK_DIR}/jdk
126 ln -s -T ${DAILY_TESTS_DIRJCK_DIR}/builds/Icedtea7_forest_2_3/openjdk/build/linux-amd64/j2sdk-image/ ${JCK_DIR}/jdk
127 ls -l ${JCK_DIR}/
128
129 run_tck 2
130 sleep 10
131 finish_tck 2
132 }
133
134 function run_tck3()
135 {
136 rm ${JCK_DIR}/jdk
137 ln -s -T ${DAILY_TESTS_DIRJCK_DIR}/builds/Icedtea7_forest_2_4/openjdk/build/linux-amd64/j2sdk-image/ ${JCK_DIR}/jdk
138 ls -l ${JCK_DIR}/
139
140 run_tck 3
141 sleep 10
142 finish_tck 3
143 }
144
145 function main()
146 {
147 echo "Starting"
148 run_tck1
149 run_tck2
150 run_tck3
151 }
152
153 main
154