forked from AdoptOpenJDK/BuildHelpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunJtregTests.sh
110 lines (98 loc) · 4.11 KB
/
runJtregTests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
set -eu
#
# runJtregTests.sh - runs JTregTests given a valid package / group name.
#
# Copyright (c) 2012 Mani Sarkar <[email protected]> All rights reserved.
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not write to the Free Software Foundation
# Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA.
#
# Declare an array contain list of valid package names - case sensitive hence they must match any comparison checks
declare -a openJDKTestPackages=("default" "all" "jdk_awt" "jdk_beans1" "jdk_io" "jdk_lang" "jdk_jfr" "jdk_math" "jdk_misc" "jdk_net" "jdk_nio1" "jdk_nio2" "jdk_nio3" "jdk_security1" "jdk_rmi" "jdk_sound" "jdk_swing" "jdk_text" "jdk_util");
declare firstParam="";
declare rtnResult=0;
# funtion to iterate through the list of valid OpenJDK package names and searching for the input package name
function packageNameExists() {
local testPackageName;
# no match found return 0
rtnResult=0;
# Loop through the valid names and compare it with the input string
for testPackageName in "${openJDKTestPackages[@]}"
do
#echo {"$testPackageName" == "$firstParam"};
if [[ "$testPackageName" == "$firstParam" ]];
then
# if you found a match return 1
rtnResult=1;
break;
fi
done
}
# function to display Usage message
displayUsageMessage() {
echo ""
echo "runJtregTests.sh has been invoked without a valid parameter."
echo ""
echo "Usage: runJtregTests.sh <group/package name>"
echo "e.g. runJtregTests.sh jdk_awt ----- to run tests on the awt package"
echo ""
echo "Below is a list of packages to help with the usage"
echo "=================================================="
echo "default - run default tests"
echo "all - run all tests"
echo ""
echo "jdk_awt - run awt package tests"
echo "jdk_beans1 - run beans package tests"
echo "jdk_io - run io package tests"
echo "jdk_lang - run language package tests"
echo "jdk_jfr - run jfr package tests"
echo "jdk_math - run math package tests"
echo "jdk_misc - run misc package tests"
echo "jdk_net - run net package tests"
echo "jdk_nio1 - run nio package tests"
echo "jdk_nio2 - run nio package tests"
echo "jdk_nio3 - run nio package tests"
echo "jdk_security1 - run security package tests"
echo "jdk_rmi - run rmi package tests"
echo "jdk_sound - run sound package tests"
echo "jdk_swing - run swing package tests"
echo "jdk_text - run text package tests"
echo "jdk_util - run util package tests"
echo ""
}
# Display usage details if user calls runTestRigTests without any parameter and exit the script.
if [[ $# -eq 0 ]]
then
displayUsageMessage
exit
fi
# call function with a parameter, result is returned in rtnResult
firstParam=$1;
packageNameExists;
# check if the package name check fails validity
if [[ $rtnResult -eq 0 ]];
then
# if no match is found display error, show the usage message and exit the script
echo "[$1] is not a valid OpenJDK test package name. Please refer to the usage message below for a list of valid test package names."
displayUsageMessage
exit
fi
# Perform the action by running the test for the inut package name
echo "Tests for package [$1] are being performed. Results are recorded in the [$1.log] file stored locally..."
make $1 > $1.log