aboutsummaryrefslogtreecommitdiff
path: root/io/ftwtest-sh
diff options
context:
space:
mode:
Diffstat (limited to 'io/ftwtest-sh')
-rw-r--r--io/ftwtest-sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/io/ftwtest-sh b/io/ftwtest-sh
index 837470da47..7fc82088ec 100644
--- a/io/ftwtest-sh
+++ b/io/ftwtest-sh
@@ -5,10 +5,12 @@ objpfx=$1
# We expect one parameter which is the test program. This must understand
# a number options:
-# --phys use the FTW_PHYS flag
-# --chdir use the FTW_CHDIR and print the current directory in the
-# callback
-# --depth use the FTW_DEPTH flag
+# --phys use the FTW_PHYS flag
+# --chdir use the FTW_CHDIR and print the current directory
+# in the callback
+# --depth use the FTW_DEPTH flag
+# --early-exit print file@2 item only and return non-zero from the
+# callback when it is seen
testprogram=$2
# We cannot test this as root.
@@ -136,6 +138,15 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd
EOF
rm $testout
+LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
+ sort > $testout
+
+cat <<EOF | cmp $testout - || exit 1
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+succeeded
+EOF
+rm $testout
+
rm -fr $tmpdir
exit 0