summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-11-14 10:50:34 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-11-14 10:50:34 -0500
commita4299f9bc1d3e60a7e628561e8d650c2a241e1c2 (patch)
tree91bff63782b54fa0fb6b1121536aa50faccc0d29 /tests
parent723113d5cf37a158a5d647fcb56079047c3d9f2a (diff)
downloadbfs-a4299f9bc1d3e60a7e628561e8d650c2a241e1c2.tar.xz
[WIP] Simplistic conversion from find syntax to fd
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 8d13aca..762687e 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -253,7 +253,7 @@ XTOUCH="$BIN/tests/xtouch"
# Try to resolve the path to $BFS before we cd, while also supporting
# --bfs="./bin/bfs -S ids"
-read -a BFS <<<"${BFS:-$BIN/bfs}"
+read -a BFS <<<"${BFS:-$BIN/find2fd}"
BFS[0]=$(_realpath "$(command -v "${BFS[0]}")")
# The temporary directory that will hold our test data
@@ -480,6 +480,7 @@ function bfs_verbose() {
}
function invoke_bfs() {
+ skip
bfs_verbose "$@"
"${BFS[@]}" "$@"
}
@@ -526,15 +527,19 @@ function diff_output() {
fi
}
-function bfs_diff() (
+function bfs_diff() {
bfs_verbose "$@"
- # Close the dup()'d stdout to make sure we have enough fd's for the process
- # substitution, even with low ulimit -n
- exec 3>&-
+ FD=$("${BFS[@]}" "$@")
+ if [ "$?" -ne 0 ]; then
+ skip
+ fi
- "${BFS[@]}" "$@" | sort >"$OUT"
+ eval "$FD" | sed 's|/$||' | sort >"$OUT"
local STATUS="${PIPESTATUS[0]}"
+ if [ "$STATUS" -ne 0 ]; then
+ skip
+ fi
diff_output || return $EX_DIFF
@@ -543,7 +548,7 @@ function bfs_diff() (
else
return $EX_BFS
fi
-)
+}
function skip() {
exit $EX_SKIP