summaryrefslogtreecommitdiffstats
path: root/tests/common
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-10-22 16:41:41 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-10-22 17:51:36 -0400
commita2af2746c4686201e2e0796fbdfa115d08727b86 (patch)
tree4127a4c813de4f4c91c92b0596b468cceac43a7b /tests/common
parentdd8ac68070176343a8781e67de4bbd6a071bb89d (diff)
downloadbfs-a2af2746c4686201e2e0796fbdfa115d08727b86.tar.xz
tests: Use test-specific scratch directories
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/L_ls.sh3
-rw-r--r--tests/common/L_mount.out10
-rw-r--r--tests/common/L_mount.sh16
-rw-r--r--tests/common/delete.out2
-rw-r--r--tests/common/delete.sh11
-rw-r--r--tests/common/delete_many.out2
-rw-r--r--tests/common/delete_many.sh10
-rw-r--r--tests/common/execdir_ulimit.out2
-rw-r--r--tests/common/execdir_ulimit.sh8
-rw-r--r--tests/common/inum_bind_mount.out4
-rw-r--r--tests/common/inum_bind_mount.sh10
-rw-r--r--tests/common/inum_mount.out2
-rw-r--r--tests/common/inum_mount.sh10
-rw-r--r--tests/common/ls.sh3
-rw-r--r--tests/common/mount.out8
-rw-r--r--tests/common/mount.sh12
16 files changed, 54 insertions, 59 deletions
diff --git a/tests/common/L_ls.sh b/tests/common/L_ls.sh
index ced16c6..7ee2b44 100644
--- a/tests/common/L_ls.sh
+++ b/tests/common/L_ls.sh
@@ -1,2 +1 @@
-clean_scratch
-invoke_bfs -L rainbow -ls >scratch/L_ls.out
+invoke_bfs -L rainbow -ls >"$OUT"
diff --git a/tests/common/L_mount.out b/tests/common/L_mount.out
index 2e80082..788579d 100644
--- a/tests/common/L_mount.out
+++ b/tests/common/L_mount.out
@@ -1,5 +1,5 @@
-scratch
-scratch/foo
-scratch/foo/bar
-scratch/foo/qux
-scratch/mnt
+.
+./foo
+./foo/bar
+./foo/qux
+./mnt
diff --git a/tests/common/L_mount.sh b/tests/common/L_mount.sh
index aaf9069..fd8042a 100644
--- a/tests/common/L_mount.sh
+++ b/tests/common/L_mount.sh
@@ -1,13 +1,13 @@
test "$UNAME" = "Darwin" && skip
-clean_scratch
-mkdir scratch/{foo,mnt}
+cd "$TEST"
+mkdir foo mnt
-bfs_sudo mount -t tmpfs tmpfs scratch/mnt || skip
-defer bfs_sudo umount scratch/mnt
+bfs_sudo mount -t tmpfs tmpfs mnt || skip
+defer bfs_sudo umount mnt
-ln -s ../mnt scratch/foo/bar
-"$XTOUCH" scratch/mnt/baz
-ln -s ../mnt/baz scratch/foo/qux
+ln -s ../mnt foo/bar
+"$XTOUCH" mnt/baz
+ln -s ../mnt/baz foo/qux
-bfs_diff -L scratch -mount
+bfs_diff -L . -mount
diff --git a/tests/common/delete.out b/tests/common/delete.out
index fb188b9..9c558e3 100644
--- a/tests/common/delete.out
+++ b/tests/common/delete.out
@@ -1 +1 @@
-scratch
+.
diff --git a/tests/common/delete.sh b/tests/common/delete.sh
index 89cf2a2..638f307 100644
--- a/tests/common/delete.sh
+++ b/tests/common/delete.sh
@@ -1,7 +1,4 @@
-clean_scratch
-"$XTOUCH" -p scratch/foo/bar/baz
-
-# Don't try to delete '.'
-(cd scratch && invoke_bfs . -delete)
-
-bfs_diff scratch
+cd "$TEST"
+"$XTOUCH" -p foo/bar/baz
+invoke_bfs . -delete
+bfs_diff .
diff --git a/tests/common/delete_many.out b/tests/common/delete_many.out
index fb188b9..9c558e3 100644
--- a/tests/common/delete_many.out
+++ b/tests/common/delete_many.out
@@ -1 +1 @@
-scratch
+.
diff --git a/tests/common/delete_many.sh b/tests/common/delete_many.sh
index 6274319..48fe4c2 100644
--- a/tests/common/delete_many.sh
+++ b/tests/common/delete_many.sh
@@ -1,8 +1,8 @@
# Test for https://github.com/tavianator/bfs/issues/67
-clean_scratch
-mkdir scratch/foo
-"$XTOUCH" scratch/foo/{1..256}
+cd "$TEST"
+mkdir foo
+"$XTOUCH" foo/{1..256}
-invoke_bfs scratch/foo -delete
-bfs_diff scratch
+invoke_bfs foo -delete
+bfs_diff .
diff --git a/tests/common/execdir_ulimit.out b/tests/common/execdir_ulimit.out
index 7f53982..bf52c09 100644
--- a/tests/common/execdir_ulimit.out
+++ b/tests/common/execdir_ulimit.out
@@ -1,3 +1,4 @@
+./.
./0
./1
./2
@@ -30,7 +31,6 @@
./q
./r
./s
-./scratch
./t
./u
./v
diff --git a/tests/common/execdir_ulimit.sh b/tests/common/execdir_ulimit.sh
index f7fc467..90c93c1 100644
--- a/tests/common/execdir_ulimit.sh
+++ b/tests/common/execdir_ulimit.sh
@@ -1,6 +1,6 @@
-clean_scratch
-mkdir -p scratch/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
-mkdir -p scratch/a/b/c/d/e/f/g/h/i/j/k/l/m/0/1/2/3/4/5/6/7/8/9/A/B/C
+cd "$TEST"
+mkdir -p a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
+mkdir -p a/b/c/d/e/f/g/h/i/j/k/l/m/0/1/2/3/4/5/6/7/8/9/A/B/C
ulimit -n 13
-bfs_diff scratch -execdir echo {} \;
+bfs_diff . -execdir echo {} \;
diff --git a/tests/common/inum_bind_mount.out b/tests/common/inum_bind_mount.out
index a520de3..ede8749 100644
--- a/tests/common/inum_bind_mount.out
+++ b/tests/common/inum_bind_mount.out
@@ -1,2 +1,2 @@
-scratch/bar
-scratch/foo
+./bar
+./foo
diff --git a/tests/common/inum_bind_mount.sh b/tests/common/inum_bind_mount.sh
index 47f7c36..892713e 100644
--- a/tests/common/inum_bind_mount.sh
+++ b/tests/common/inum_bind_mount.sh
@@ -1,9 +1,9 @@
test "$UNAME" = "Linux" || skip
-clean_scratch
-"$XTOUCH" scratch/{foo,bar}
+cd "$TEST"
+"$XTOUCH" foo bar baz
-bfs_sudo mount --bind scratch/{foo,bar} || skip
-defer bfs_sudo umount scratch/bar
+bfs_sudo mount --bind foo bar || skip
+defer bfs_sudo umount bar
-bfs_diff scratch -inum "$(inum scratch/bar)"
+bfs_diff . -inum "$(inum bar)"
diff --git a/tests/common/inum_mount.out b/tests/common/inum_mount.out
index 99c7511..99fa01e 100644
--- a/tests/common/inum_mount.out
+++ b/tests/common/inum_mount.out
@@ -1 +1 @@
-scratch/mnt
+./mnt
diff --git a/tests/common/inum_mount.sh b/tests/common/inum_mount.sh
index 1bf2d86..7facf57 100644
--- a/tests/common/inum_mount.sh
+++ b/tests/common/inum_mount.sh
@@ -1,9 +1,9 @@
test "$UNAME" = "Darwin" && skip
-clean_scratch
-mkdir scratch/{foo,mnt}
+cd "$TEST"
+mkdir foo mnt
-bfs_sudo mount -t tmpfs tmpfs scratch/mnt || skip
-defer bfs_sudo umount scratch/mnt
+bfs_sudo mount -t tmpfs tmpfs mnt || skip
+defer bfs_sudo umount mnt
-bfs_diff scratch -inum "$(inum scratch/mnt)"
+bfs_diff . -inum "$(inum mnt)"
diff --git a/tests/common/ls.sh b/tests/common/ls.sh
index 85ca39c..bc50d90 100644
--- a/tests/common/ls.sh
+++ b/tests/common/ls.sh
@@ -1,2 +1 @@
-clean_scratch
-invoke_bfs rainbow -ls >scratch/ls.out
+invoke_bfs rainbow -ls >"$OUT"
diff --git a/tests/common/mount.out b/tests/common/mount.out
index f7839fb..6253434 100644
--- a/tests/common/mount.out
+++ b/tests/common/mount.out
@@ -1,4 +1,4 @@
-scratch
-scratch/foo
-scratch/foo/bar
-scratch/mnt
+.
+./foo
+./foo/bar
+./mnt
diff --git a/tests/common/mount.sh b/tests/common/mount.sh
index db8b801..c9abde5 100644
--- a/tests/common/mount.sh
+++ b/tests/common/mount.sh
@@ -1,11 +1,11 @@
test "$UNAME" = "Darwin" && skip
-clean_scratch
-mkdir scratch/{foo,mnt}
+cd "$TEST"
+mkdir foo mnt
-bfs_sudo mount -t tmpfs tmpfs scratch/mnt || skip
-defer bfs_sudo umount scratch/mnt
+bfs_sudo mount -t tmpfs tmpfs mnt || skip
+defer bfs_sudo umount mnt
-"$XTOUCH" scratch/foo/bar scratch/mnt/baz
+"$XTOUCH" foo/bar mnt/baz
-bfs_diff scratch -mount
+bfs_diff . -mount