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() {
|
||||
cat >&2 <<EOF
|
||||
Usage: $0 [-W] [testfile]...
|
||||
-v: verbose mode
|
||||
-W: warnings become errors
|
||||
-h: show this help
|
||||
EOF
|
||||
exit "$1"
|
||||
}
|
||||
while getopts Wh opt; do
|
||||
fail_on_warning=
|
||||
verbose=${VERBOSE:-0}
|
||||
while getopts vWh opt; do
|
||||
case $opt in
|
||||
v) verbose=1 ;;
|
||||
W) fail_on_warning=1 ;;
|
||||
h) usage 0 ;;
|
||||
*) usage 64 ;;
|
||||
|
@ -33,8 +37,7 @@ while getopts Wh opt; do
|
|||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
VERBOSE=${VERBOSE-0}
|
||||
if [ "$VERBOSE" = 1 ]; then
|
||||
if [[ $verbose ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
|
@ -119,9 +122,7 @@ awesome_log=$tmp_files/_awesome_test.log
|
|||
echo "awesome_log: $awesome_log"
|
||||
|
||||
wait_until_success() {
|
||||
if [ "$VERBOSE" = 1 ]; then
|
||||
set +x
|
||||
fi
|
||||
if [[ $verbose ]]; then set +x; fi
|
||||
wait_count=60 # 60*0.05s => 3s.
|
||||
while true; do
|
||||
set +e
|
||||
|
@ -144,9 +145,7 @@ wait_until_success() {
|
|||
fi
|
||||
sleep 0.05
|
||||
done
|
||||
if [ "$VERBOSE" = 1 ]; then
|
||||
set -x
|
||||
fi
|
||||
if [[ $verbose ]]; then set -x; fi
|
||||
}
|
||||
|
||||
# Wait for DISPLAY to be available, and setup xrdb,
|
||||
|
|
Loading…
Reference in New Issue