Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/tools/jpackage/test_jpackage.sh
41144 views
1
#!/bin/bash
2
3
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
#
6
# This code is free software; you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License version 2 only, as
8
# published by the Free Software Foundation.
9
#
10
# This code is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
# version 2 for more details (a copy is included in the LICENSE file that
14
# accompanied this code).
15
#
16
# You should have received a copy of the GNU General Public License version
17
# 2 along with this work; if not, write to the Free Software Foundation,
18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
#
20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
# or visit www.oracle.com if you need additional information or have any
22
# questions.
23
24
25
#
26
# Complete testing of jpackage platform-specific packaging.
27
#
28
# The script does the following:
29
# 1. Create packages.
30
# 2. Install created packages.
31
# 3. Verifies packages are installed.
32
# 4. Uninstall created packages.
33
# 5. Verifies packages are uninstalled.
34
#
35
# For the list of accepted command line arguments see `run_tests.sh` script.
36
#
37
38
# Fail fast
39
set -e; set -o pipefail;
40
41
# Script debug
42
dry_run=${JPACKAGE_TEST_DRY_RUN}
43
44
# Default directory where jpackage should write bundle files
45
output_dir=~/jpackage_bundles
46
47
48
set_args ()
49
{
50
args=()
51
local arg_is_output_dir=
52
local arg_is_mode=
53
local output_dir_set=
54
local with_append_actions=yes
55
for arg in "$@"; do
56
if [ "$arg" == "-o" ]; then
57
arg_is_output_dir=yes
58
output_dir_set=yes
59
elif [ "$arg" == "-m" ]; then
60
arg_is_mode=yes
61
continue
62
elif [ "$arg" == '--' ]; then
63
append_actions
64
with_append_actions=
65
continue
66
elif ! case "$arg" in -Djpackage.test.action=*) false;; esac; then
67
continue
68
elif [ -n "$arg_is_output_dir" ]; then
69
arg_is_output_dir=
70
output_dir="$arg"
71
elif [ -n "$arg_is_mode" ]; then
72
arg_is_mode=
73
continue
74
fi
75
76
args+=( "$arg" )
77
done
78
[ -n "$output_dir_set" ] || args=( -o "$output_dir" "${args[@]}" )
79
[ -z "$with_append_actions" ] || append_actions
80
}
81
82
83
append_actions ()
84
{
85
args+=( '--' '-Djpackage.test.action=create,install,verify-install,uninstall,verify-uninstall' )
86
}
87
88
89
exec_command ()
90
{
91
if [ -n "$dry_run" ]; then
92
echo "$@"
93
else
94
eval "$@"
95
fi
96
}
97
98
set_args "$@"
99
basedir="$(dirname $0)"
100
exec_command ${SHELL} "$basedir/run_tests.sh" -m create "${args[@]}"
101
102