tests/run.sh: fix verbose mode (#1997)

Fixes https://github.com/awesomeWM/awesome/issues/1996.

Also improves usage information.
This commit is contained in:
Daniel Hahler 2017-08-16 11:27:32 +02:00 committed by GitHub
parent b8ad56ad81
commit cdaf0dd294
1 changed files with 6 additions and 4 deletions

View File

@ -18,7 +18,9 @@ export HOME=/dev/null
# Parse options. # Parse options.
usage() { usage() {
cat >&2 <<EOF cat >&2 <<EOF
Usage: $0 [-W] [testfile]... Usage: $0 [OPTION]... [FILE]...
Options:
-v: verbose mode -v: verbose mode
-W: warnings become errors -W: warnings become errors
-h: show this help -h: show this help
@ -37,7 +39,7 @@ while getopts vWh opt; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [[ $verbose ]]; then if (( verbose )); then
set -x set -x
fi fi
@ -122,7 +124,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 ]]; then set +x; fi if (( verbose )); then 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
@ -145,7 +147,7 @@ wait_until_success() {
fi fi
sleep 0.05 sleep 0.05
done done
if [[ $verbose ]]; then set -x; fi if (( verbose )); then set -x; fi
} }
# Wait for DISPLAY to be available, and setup xrdb, # Wait for DISPLAY to be available, and setup xrdb,