summaryrefslogtreecommitdiffstats
path: root/tests/gnu
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-12-16 15:32:04 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-12-16 15:32:04 -0500
commite50c19f284dad6b4b7b79f91cc8576a97626be8a (patch)
tree3fc7b15a412d4123d403bca6fdbf3225389926e1 /tests/gnu
parent7d87b96b421b76e387cee903b7b7c1bc16c54310 (diff)
downloadbfs-e50c19f284dad6b4b7b79f91cc8576a97626be8a.tar.xz
tests: Turn on set -e
Diffstat (limited to 'tests/gnu')
-rw-r--r--tests/gnu/L_delete.sh2
-rw-r--r--tests/gnu/L_loops_continue.sh3
-rw-r--r--tests/gnu/inum_automount.sh8
-rw-r--r--tests/gnu/printf_Y_error.sh10
-rw-r--r--tests/gnu/xtype_bind_mount.sh8
5 files changed, 11 insertions, 20 deletions
diff --git a/tests/gnu/L_delete.sh b/tests/gnu/L_delete.sh
index 6ec167c..8fdb12a 100644
--- a/tests/gnu/L_delete.sh
+++ b/tests/gnu/L_delete.sh
@@ -4,6 +4,6 @@ mkdir scratch/bar
ln -s ../foo scratch/bar/baz
# Don't try to rmdir() a symlink
-invoke_bfs -L scratch/bar -delete || return 1
+invoke_bfs -L scratch/bar -delete
bfs_diff scratch
diff --git a/tests/gnu/L_loops_continue.sh b/tests/gnu/L_loops_continue.sh
index 0244137..d4c95f1 100644
--- a/tests/gnu/L_loops_continue.sh
+++ b/tests/gnu/L_loops_continue.sh
@@ -1,2 +1 @@
-bfs_diff -L loops
-[ $? -eq $EX_BFS ]
+check_exit $EX_BFS bfs_diff -L loops
diff --git a/tests/gnu/inum_automount.sh b/tests/gnu/inum_automount.sh
index 6bf2977..da2e3b0 100644
--- a/tests/gnu/inum_automount.sh
+++ b/tests/gnu/inum_automount.sh
@@ -5,13 +5,11 @@ command -v systemd-mount &>/dev/null || skip
clean_scratch
mkdir scratch/{foo,automnt}
+
sudo systemd-mount -A -o bind basic scratch/automnt || skip
+trap "sudo systemd-umount scratch/automnt" EXIT
before=$(inum scratch/automnt)
bfs_diff scratch -inum "$before" -prune
-ret=$?
after=$(inum scratch/automnt)
-
-sudo systemd-umount scratch/automnt
-
-((ret == 0 && before == after))
+((before == after))
diff --git a/tests/gnu/printf_Y_error.sh b/tests/gnu/printf_Y_error.sh
index 6487711..e9a2083 100644
--- a/tests/gnu/printf_Y_error.sh
+++ b/tests/gnu/printf_Y_error.sh
@@ -1,12 +1,8 @@
clean_scratch
mkdir scratch/foo
-chmod -x scratch/foo
ln -s foo/bar scratch/bar
-bfs_diff scratch -printf '(%p) (%l) %y %Y\n'
-ret=$?
-
-chmod +x scratch/foo
-clean_scratch
+chmod -x scratch/foo
+trap "chmod +x scratch/foo" EXIT
-[ $ret -eq $EX_BFS ]
+check_exit $EX_BFS bfs_diff scratch -printf '(%p) (%l) %y %Y\n'
diff --git a/tests/gnu/xtype_bind_mount.sh b/tests/gnu/xtype_bind_mount.sh
index a6dbed3..9babd9d 100644
--- a/tests/gnu/xtype_bind_mount.sh
+++ b/tests/gnu/xtype_bind_mount.sh
@@ -3,11 +3,9 @@ test "$UNAME" = "Linux" || skip
clean_scratch
"$XTOUCH" scratch/{file,null}
-sudo mount --bind /dev/null scratch/null
ln -s /dev/null scratch/link
-bfs_diff -L scratch -type c
-ret=$?
+sudo mount --bind /dev/null scratch/null
+trap "sudo umount scratch/null" EXIT
-sudo umount scratch/null
-return $ret
+bfs_diff -L scratch -type c