This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geimTests
executable file
·135 lines (115 loc) · 3.55 KB
/
geimTests
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env bash
#
# This script is used to automate some testing of geim (ge-install-manager)
#
tmp_file=/tmp/geimTests.proton-ge-custom.releases
log_file=geimLog_$(date '+%F_%T').log
debug_log=geimDebugLog_$(date '+%F_%T').log
notes_log=geimReleaseNotes_$(date '+%F_%T').log
rm -vf "$tmp_file" "$log_file" "$debug_log" "$notes_log"
##touch "$tmp_file" "$log_file" "$debug_log" "$notes_log" || exit 1
CleanUp() {
rm -f "$tmp_file"
unset GEIM_TESTS
}
trap 'CleanUp' EXIT
# Disable color escape codes in script stderr verbose output
export GEIM_TESTS=1
# Nuke previous state
NukePreviousState() {
echo "Nuking previous state"
rm -- *.log
ge-install-manager -fXD
}
err_exit() {
echo "error"
exit 1
}
# Get a list of the available releases
# Parse ge-install-manager -L output into a tmp file
GetReleasesList() {
while IFS= read -r
do
REPLY=${REPLY%%[[:blank:]]*}
REPLY=${REPLY//Proton-}
printf '%s\n' "$REPLY" >> "$tmp_file"
done < <(ge-install-manager -L)
}
InstallSmallRelease() {
if ge-install-manager -zd "Proton-5.1-GE-1" 2>>"${debug_log}"
then
if ge-install-manager -zi "Proton-5.1-GE-1" 2>>"${debug_log}"
then
if ! ge-install-manager -zs "Proton-5.1-GE-1" 2>>"${debug_log}" 1>>"$log_file"
then
err_exit
fi
else
err_exit
fi
else
err_exit
fi
}
InstallAllReleases() {
GetReleasesList
while IFS= read -r
do
[[ -z $REPLY ]] && continue
ge-install-manager -zi "$REPLY" 2>>"$debug_log"
done < "$tmp_file"
}
VerifyAll() {
ge-install-manager -zV 2>>"${debug_log}"
}
# shellcheck disable=SC2129
[[ -f $tmp_file && $(stat -c '%s' "$tmp_file") -gt 0 ]] && printf '%s\n%s\n\n' "ge-install-manager -L:" "$(cat "$tmp_file")" >> "$log_file"
printf '%s\n\n' "$(ge-install-manager -l)" >> "$log_file"
GroupTests() {
# List patch notes for each installed version
while IFS= read -r || [[ -n $REPLY ]]
do
[[ $REPLY != *'.tar.gz'* && $REPLY == *'Proton-'* ]] && {
# Remove extra info
REPLY=${REPLY//[[:blank:]]}
REPLY=${REPLY%'('*}
# Fix for 5.0-ge-1-no-mouse-coord
REPLY=${REPLY//'5.0-GE-1'/'5.0-GE-1-no-mouse-coord'}
if ge-install-manager -zR "$REPLY" 1>>"$log_file" 2>>"$debug_log"
then
if ge-install-manager -zr "$REPLY" 1>>"$log_file" 2>>"$debug_log"
then
if ge-install-manager -zi "$REPLY" 2>>"$debug_log"
then
if ge-install-manager -zv "$REPLY" 2>>"$debug_log"
then
if ge-install-manager -zn "$REPLY" 2>>"$debug_log" | tee -a "$notes_log"
then
echo "All tests succeeded"
else
err_exit
fi
else
err_exit
fi
else
err_exit
fi
else
err_exit
fi
else
err_exit
fi
}
done < <(ge-install-manager -l)
ge-install-manager -S 1>>"$log_file"
printf '\n' >> "$log_file"
sync -- *.log
echo "All tests completed"
}
[[ $1 = 'nuke' ]] && NukePreviousState
[[ $1 = 'full' ]] && InstallAllReleases
#[[ -z $1 ]] && InstallSmallRelease
# Run GroupTests()
GroupTests