From 9192487a267f7052924db88d88cf381513c773d2 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 19 Oct 2022 14:29:35 -0400 Subject: tests: Coverage number go up --- tests/bfs/D_incomplete.sh | 1 + tests/bfs/D_unknown.out | 19 +++++++++++++++++++ tests/bfs/D_unknown.sh | 4 ++++ tests/bfs/O9.out | 19 +++++++++++++++++++ tests/bfs/O9.sh | 4 ++++ tests/bfs/nocolor.out | 20 ++++++++++++++++++++ tests/bfs/nocolor.sh | 1 + tests/bfs/warn.sh | 2 -- tests/bfs/warn_depth_prune.sh | 2 ++ tests/bfs/warn_exclude_path.sh | 2 ++ tests/bsd/f_incomplete.sh | 2 ++ tests/bsd/mtime_bad_unit.sh | 1 + tests/bsd/mtime_missing_unit.sh | 1 + tests/common/maxdepth_incomplete.sh | 1 + tests/common/mindepth_incomplete.sh | 1 + tests/gnu/files0_from_error.sh | 1 + tests/gnu/fls_nonexistent.sh | 1 + tests/gnu/fprint0_nonexistent.sh | 1 + tests/gnu/fprintf_nonexistent.sh | 1 + tests/gnu/noleaf.out | 19 +++++++++++++++++++ tests/gnu/noleaf.sh | 1 + tests/posix/newer_nonexistent.sh | 1 + tests/tests.sh | 2 -- 23 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 tests/bfs/D_incomplete.sh create mode 100644 tests/bfs/D_unknown.out create mode 100644 tests/bfs/D_unknown.sh create mode 100644 tests/bfs/O9.out create mode 100644 tests/bfs/O9.sh create mode 100644 tests/bfs/nocolor.out create mode 100644 tests/bfs/nocolor.sh delete mode 100644 tests/bfs/warn.sh create mode 100644 tests/bfs/warn_depth_prune.sh create mode 100644 tests/bfs/warn_exclude_path.sh create mode 100644 tests/bsd/f_incomplete.sh create mode 100644 tests/bsd/mtime_bad_unit.sh create mode 100644 tests/bsd/mtime_missing_unit.sh create mode 100644 tests/common/maxdepth_incomplete.sh create mode 100644 tests/common/mindepth_incomplete.sh create mode 100644 tests/gnu/files0_from_error.sh create mode 100644 tests/gnu/fls_nonexistent.sh create mode 100644 tests/gnu/fprint0_nonexistent.sh create mode 100644 tests/gnu/fprintf_nonexistent.sh create mode 100644 tests/gnu/noleaf.out create mode 100644 tests/gnu/noleaf.sh create mode 100644 tests/posix/newer_nonexistent.sh diff --git a/tests/bfs/D_incomplete.sh b/tests/bfs/D_incomplete.sh new file mode 100644 index 0000000..396d365 --- /dev/null +++ b/tests/bfs/D_incomplete.sh @@ -0,0 +1 @@ +fail invoke_bfs -D diff --git a/tests/bfs/D_unknown.out b/tests/bfs/D_unknown.out new file mode 100644 index 0000000..a7ccfe4 --- /dev/null +++ b/tests/bfs/D_unknown.out @@ -0,0 +1,19 @@ +basic +basic/a +basic/b +basic/c +basic/c/d +basic/e +basic/e/f +basic/g +basic/g/h +basic/i +basic/j +basic/j/foo +basic/k +basic/k/foo +basic/k/foo/bar +basic/l +basic/l/foo +basic/l/foo/bar +basic/l/foo/bar/baz diff --git a/tests/bfs/D_unknown.sh b/tests/bfs/D_unknown.sh new file mode 100644 index 0000000..e3614ba --- /dev/null +++ b/tests/bfs/D_unknown.sh @@ -0,0 +1,4 @@ +stderr=$(invoke_bfs -warn -D unknown basic 2>&1 >"$OUT") +[ -n "$stderr" ] || return 1 +sort_output +diff_output diff --git a/tests/bfs/O9.out b/tests/bfs/O9.out new file mode 100644 index 0000000..a7ccfe4 --- /dev/null +++ b/tests/bfs/O9.out @@ -0,0 +1,19 @@ +basic +basic/a +basic/b +basic/c +basic/c/d +basic/e +basic/e/f +basic/g +basic/g/h +basic/i +basic/j +basic/j/foo +basic/k +basic/k/foo +basic/k/foo/bar +basic/l +basic/l/foo +basic/l/foo/bar +basic/l/foo/bar/baz diff --git a/tests/bfs/O9.sh b/tests/bfs/O9.sh new file mode 100644 index 0000000..12f6c2d --- /dev/null +++ b/tests/bfs/O9.sh @@ -0,0 +1,4 @@ +stderr=$(invoke_bfs -warn -O9 basic 2>&1 >"$OUT") +[ -n "$stderr" ] || return 1 +sort_output +diff_output diff --git a/tests/bfs/nocolor.out b/tests/bfs/nocolor.out new file mode 100644 index 0000000..b53fe03 --- /dev/null +++ b/tests/bfs/nocolor.out @@ -0,0 +1,20 @@ +rainbow +rainbow/broken +rainbow/chardev_link +rainbow/exec.sh +rainbow/file.dat +rainbow/file.txt +rainbow/link.txt +rainbow/mh1 +rainbow/mh2 +rainbow/ow +rainbow/pipe +rainbow/sgid +rainbow/socket +rainbow/star.gz +rainbow/star.tar +rainbow/star.tar.gz +rainbow/sticky +rainbow/sticky_ow +rainbow/sugid +rainbow/suid diff --git a/tests/bfs/nocolor.sh b/tests/bfs/nocolor.sh new file mode 100644 index 0000000..8dace0b --- /dev/null +++ b/tests/bfs/nocolor.sh @@ -0,0 +1 @@ +bfs_diff rainbow -nocolor diff --git a/tests/bfs/warn.sh b/tests/bfs/warn.sh deleted file mode 100644 index 0f613c8..0000000 --- a/tests/bfs/warn.sh +++ /dev/null @@ -1,2 +0,0 @@ -stderr=$(invoke_bfs basic -warn -depth -prune 2>&1 >/dev/null) -[ -n "$stderr" ] diff --git a/tests/bfs/warn_depth_prune.sh b/tests/bfs/warn_depth_prune.sh new file mode 100644 index 0000000..0f613c8 --- /dev/null +++ b/tests/bfs/warn_depth_prune.sh @@ -0,0 +1,2 @@ +stderr=$(invoke_bfs basic -warn -depth -prune 2>&1 >/dev/null) +[ -n "$stderr" ] diff --git a/tests/bfs/warn_exclude_path.sh b/tests/bfs/warn_exclude_path.sh new file mode 100644 index 0000000..988544e --- /dev/null +++ b/tests/bfs/warn_exclude_path.sh @@ -0,0 +1,2 @@ +stderr=$(invoke_bfs -warn -exclude basic -name '*f*' 2>&1 >/dev/null) +[ -n "$stderr" ] diff --git a/tests/bsd/f_incomplete.sh b/tests/bsd/f_incomplete.sh new file mode 100644 index 0000000..acb63af --- /dev/null +++ b/tests/bsd/f_incomplete.sh @@ -0,0 +1,2 @@ +fail invoke_bfs -f + diff --git a/tests/bsd/mtime_bad_unit.sh b/tests/bsd/mtime_bad_unit.sh new file mode 100644 index 0000000..3921f80 --- /dev/null +++ b/tests/bsd/mtime_bad_unit.sh @@ -0,0 +1 @@ +fail invoke_bfs times -mtime +1q diff --git a/tests/bsd/mtime_missing_unit.sh b/tests/bsd/mtime_missing_unit.sh new file mode 100644 index 0000000..3ac4c97 --- /dev/null +++ b/tests/bsd/mtime_missing_unit.sh @@ -0,0 +1 @@ +fail invoke_bfs times -mtime +1w2 diff --git a/tests/common/maxdepth_incomplete.sh b/tests/common/maxdepth_incomplete.sh new file mode 100644 index 0000000..536dcf5 --- /dev/null +++ b/tests/common/maxdepth_incomplete.sh @@ -0,0 +1 @@ +fail invoke_bfs basic -maxdepth diff --git a/tests/common/mindepth_incomplete.sh b/tests/common/mindepth_incomplete.sh new file mode 100644 index 0000000..19a3b21 --- /dev/null +++ b/tests/common/mindepth_incomplete.sh @@ -0,0 +1 @@ +fail invoke_bfs basic -mindepth diff --git a/tests/gnu/files0_from_error.sh b/tests/gnu/files0_from_error.sh new file mode 100644 index 0000000..ab27ea2 --- /dev/null +++ b/tests/gnu/files0_from_error.sh @@ -0,0 +1 @@ +fail invoke_bfs -files0-from basic diff --git a/tests/gnu/fls_nonexistent.sh b/tests/gnu/fls_nonexistent.sh new file mode 100644 index 0000000..4756834 --- /dev/null +++ b/tests/gnu/fls_nonexistent.sh @@ -0,0 +1 @@ +fail invoke_bfs rainbow -fls scratch/nonexistent/path diff --git a/tests/gnu/fprint0_nonexistent.sh b/tests/gnu/fprint0_nonexistent.sh new file mode 100644 index 0000000..d8e0f30 --- /dev/null +++ b/tests/gnu/fprint0_nonexistent.sh @@ -0,0 +1 @@ +fail invoke_bfs basic -fprint0 scratch/nonexistent/path diff --git a/tests/gnu/fprintf_nonexistent.sh b/tests/gnu/fprintf_nonexistent.sh new file mode 100644 index 0000000..6ed141a --- /dev/null +++ b/tests/gnu/fprintf_nonexistent.sh @@ -0,0 +1 @@ +fail invoke_bfs basic -fprintf scratch/nonexistent/path '%p\n' diff --git a/tests/gnu/noleaf.out b/tests/gnu/noleaf.out new file mode 100644 index 0000000..a7ccfe4 --- /dev/null +++ b/tests/gnu/noleaf.out @@ -0,0 +1,19 @@ +basic +basic/a +basic/b +basic/c +basic/c/d +basic/e +basic/e/f +basic/g +basic/g/h +basic/i +basic/j +basic/j/foo +basic/k +basic/k/foo +basic/k/foo/bar +basic/l +basic/l/foo +basic/l/foo/bar +basic/l/foo/bar/baz diff --git a/tests/gnu/noleaf.sh b/tests/gnu/noleaf.sh new file mode 100644 index 0000000..b19438c --- /dev/null +++ b/tests/gnu/noleaf.sh @@ -0,0 +1 @@ +bfs_diff basic -noleaf diff --git a/tests/posix/newer_nonexistent.sh b/tests/posix/newer_nonexistent.sh new file mode 100644 index 0000000..789cadf --- /dev/null +++ b/tests/posix/newer_nonexistent.sh @@ -0,0 +1 @@ +fail invoke_bfs times -newer times/nonexistent diff --git a/tests/tests.sh b/tests/tests.sh index d957cf1..f6fe506 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -16,8 +16,6 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # ############################################################################ -shopt -s extdebug - set -euP umask 022 -- cgit v1.2.3