5
echo "Usage: runtests <architecture>" >&2
13
[ "$TEST_VERBOSE" ] || export TEST_VERBOSE=1
16
if [ "$TEST_VERBOSE" -ge 2 ]; then
22
# Run a test based on a test file.
26
unset SUBARCH CPUINFO MACHINE FLAVOUR KERNEL_26 KERNEL_7 KERNEL_8 USABLE UNUSABLE \
31
while read name value; do
37
CPUINFO="${TEST%/*}/$value"
67
# TODO: is there any quote-safe way to do
69
eval "export ${value%% *}='${value#* }'"
74
export ARCH SUBARCH CPUINFO NUMCPUS MACHINE
75
export MAJORS FLAVOUR KERNEL_26 KERNEL_7 KERNEL_8
76
export USABLE UNUSABLE
78
TMP="$(mktemp -t base-installer-tests.XXXXXX)"
79
trap 'rm -f "$TMP"' 0 HUP INT QUIT TERM
81
# Run the actual testset.
82
verbose ./dotest >"$TMP"
84
# Massage testset output into a more useful form.
85
while read state message; do
88
PASSES="$(($PASSES + 1))"
91
FAILURES="$(($FAILURES + 1))"
94
if [ "$state" != PASS ] || [ "$TEST_VERBOSE" -ge 2 ]; then
95
echo "$state $TEST $message"
99
trap 0 HUP INT QUIT TERM
106
for test in "$ARCH"/*.test; do
107
# Sanity check: check test file for incorrect line continuations
108
if ! awk 'BEGIN {lc=0}
109
/\\[[:space:]]*$/ {if (lc==1 && substr($0,1,1)!=" ") {exit 1}; lc=1}
110
/[^\\][:space:]*$/ {lc=0}
111
END {if (lc==1) {exit 1}}' $test
113
echo "Incorrect line continuation in test file '$test'"
120
if [ "$TEST_VERBOSE" -ge 1 ]; then
121
echo "$ARCH: $PASSES passes, $FAILURES failures."
124
if [ "$FAILURES" -eq 0 ]; then