From d0218bfe548d98db3656e43e33e5f3f807542312 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sat, 30 Nov 2024 22:25:20 +0000 Subject: [PATCH] Skip this test where "-d" is not available. --- tests/Watchfd_-_Single_descriptor.test | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Watchfd_-_Single_descriptor.test b/tests/Watchfd_-_Single_descriptor.test index c5362b3..09909a4 100755 --- a/tests/Watchfd_-_Single_descriptor.test +++ b/tests/Watchfd_-_Single_descriptor.test @@ -21,6 +21,12 @@ pid=$! sleep 0.1 "${testSubject}" -d "${pid}:0" -f -i 0.5 >/dev/null 2>"${workFile2}" +# Skip the test if "-d" does not work. +if grep -Fq ' -d: not available' "${workFile2}"; then + echo "no \`--watchfd' / \`-d' option on this platform" + exit 77 +fi + # There should be at least 2 different numbers starting the output lines. positionsReported="$(tr '\r' '\n' < "${workFile2}" | awk '{print $1}' | sort -n | uniq)" differentNumbers="$(printf "%s\n" "${positionsReported}" | grep -Ec .)"