tests/run.sh: add -v option, replacing/using VERBOSE
This commit is contained in:
parent
f8d1e46eaa
commit
52548a2bee
17
tests/run.sh
17
tests/run.sh
|
@ -19,13 +19,17 @@ export HOME=/dev/null
|
||||||
usage() {
|
usage() {
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
Usage: $0 [-W] [testfile]...
|
Usage: $0 [-W] [testfile]...
|
||||||
|
-v: verbose mode
|
||||||
-W: warnings become errors
|
-W: warnings become errors
|
||||||
-h: show this help
|
-h: show this help
|
||||||
EOF
|
EOF
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
while getopts Wh opt; do
|
fail_on_warning=
|
||||||
|
verbose=${VERBOSE:-0}
|
||||||
|
while getopts vWh opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
v) verbose=1 ;;
|
||||||
W) fail_on_warning=1 ;;
|
W) fail_on_warning=1 ;;
|
||||||
h) usage 0 ;;
|
h) usage 0 ;;
|
||||||
*) usage 64 ;;
|
*) usage 64 ;;
|
||||||
|
@ -33,8 +37,7 @@ while getopts Wh opt; do
|
||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
VERBOSE=${VERBOSE-0}
|
if [[ $verbose ]]; then
|
||||||
if [ "$VERBOSE" = 1 ]; then
|
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -119,9 +122,7 @@ awesome_log=$tmp_files/_awesome_test.log
|
||||||
echo "awesome_log: $awesome_log"
|
echo "awesome_log: $awesome_log"
|
||||||
|
|
||||||
wait_until_success() {
|
wait_until_success() {
|
||||||
if [ "$VERBOSE" = 1 ]; then
|
if [[ $verbose ]]; then set +x; fi
|
||||||
set +x
|
|
||||||
fi
|
|
||||||
wait_count=60 # 60*0.05s => 3s.
|
wait_count=60 # 60*0.05s => 3s.
|
||||||
while true; do
|
while true; do
|
||||||
set +e
|
set +e
|
||||||
|
@ -144,9 +145,7 @@ wait_until_success() {
|
||||||
fi
|
fi
|
||||||
sleep 0.05
|
sleep 0.05
|
||||||
done
|
done
|
||||||
if [ "$VERBOSE" = 1 ]; then
|
if [[ $verbose ]]; then set -x; fi
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wait for DISPLAY to be available, and setup xrdb,
|
# Wait for DISPLAY to be available, and setup xrdb,
|
||||||
|
|
Loading…
Reference in New Issue