-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest
executable file
·45 lines (37 loc) · 1.36 KB
/
Test
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
#!/usr/bin/env bash
set -eu -o pipefail
output=
TEST_PASSED=false
trap ' ec=$?
$TEST_PASSED || echo "FAILURE: unexpected exit; code=$ec"
' 0
####################################################################
export PROJDIR=$(cd "$(dirname "$0")" && pwd -P)
cd "$PROJDIR"
optargs=()
pactivate_test=true
pae_test=true
while [[ ${#@} -gt 0 ]]; do case "$1" in
-C) shift; rm -rf ".build/";;
-e) shift; pactivate_test=false;;
-E) shift; pae_test=false;;
-*) optargs+=("$1"); shift;;
*) break;;
esac; done
# Default images to test:
[[ ${#@} -eq 0 ]] && set $(grep -v '^#' tscript/pactivate.arg)
header() {
echo '┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo '┃' "$@"
}
$pactivate_test && for img in "$@"; do
header tscript/pactivate "${optargs[@]}" "$img"
./tscript/pactivate "${optargs[@]}" "$img"
done
$pae_test && {
header tscript/pae "${optargs[@]}"
./tscript/pae "${optargs[@]}"
}
header "All tests passed"
echo '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
TEST_PASSED=true