summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-10-21 13:10:36 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-10-21 13:10:36 -0400
commit4e38f139f92b8b3729f82c37f0904c2b77d3eb58 (patch)
treea10f9de054cbcd2176be7666e56e0ae660bebf84 /tests.sh
parent305f75468ead1f68aad3f3b5162f7437ad8dd732 (diff)
downloadbfs-4e38f139f92b8b3729f82c37f0904c2b77d3eb58.tar.xz
Report errors that occur when closing files
Otherwise we miss write errors that occur when flushing the cache.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests.sh b/tests.sh
index 57aa47b..0f52581 100755
--- a/tests.sh
+++ b/tests.sh
@@ -376,6 +376,8 @@ gnu_tests=(
test_or_purity
test_not_reachability
test_comma_reachability
+ test_print_error
+ test_fprint_error
)
bfs_tests=(
@@ -1410,6 +1412,18 @@ function test_data_flow_type() {
bfs_diff basic \! \( -type f -o \! -type f \)
}
+function test_print_error() {
+ if [ -e /dev/full ]; then
+ ! invoke_bfs basic -maxdepth 0 >/dev/full 2>/dev/null
+ fi
+}
+
+function test_fprint_error() {
+ if [ -e /dev/full ]; then
+ ! invoke_bfs basic -maxdepth 0 -fprint /dev/full 2>/dev/null
+ fi
+}
+
if [ -t 1 -a ! "$VERBOSE" ]; then
in_place=yes
fi
@@ -1433,7 +1447,11 @@ for test in ${!run_*}; do
((++passed))
else
((++failed))
- echo "$test failed!"
+ if [ "$in_place" ]; then
+ printf '\r\033[J%s\n' "$test failed!"
+ else
+ echo "$test failed!"
+ fi
fi
done