summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-07-18 15:28:01 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-07-18 15:28:01 -0400
commit4b02d5dae771a8797868ccaddf1bbb7cf0b67c2b (patch)
treef148b38b767864dca56b24a2f4d389c6dbd4fbdb /tests.sh
parenta5b69d224074842da9f2f55fd82e400f6b62ad16 (diff)
downloadbfs-4b02d5dae771a8797868ccaddf1bbb7cf0b67c2b.tar.xz
tests.sh: Better line overwriting
This way the cursor is always at the beginning of the line, so any error output is more readable.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests.sh b/tests.sh
index a2b1681..dc619e1 100755
--- a/tests.sh
+++ b/tests.sh
@@ -1193,11 +1193,10 @@ failed=0
for test in ${!run_*}; do
test=${test#run_}
- if [ -t 1 ]; then
- printf '\r\033[J%s' "$test"
- else
- echo "$test"
+ if [ -t 1 -a $((passed + failed)) -gt 0 ]; then
+ printf '\033[A\033[J'
fi
+ echo "$test"
("$test" "$dir")
status=$?
@@ -1211,7 +1210,7 @@ for test in ${!run_*}; do
done
if [ -t 1 ]; then
- printf '\r\033[J'
+ printf '\033[A\033[J'
fi
if [ $passed -gt 0 ]; then