]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid errors on systems without getmntent
authorPádraig Brady <P@draigBrady.com>
Wed, 2 Jul 2014 09:16:04 +0000 (10:16 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 2 Jul 2014 18:45:17 +0000 (19:45 +0100)
* tests/df/no-mtab-status.sh: Skip if getmntent() not available.
* tests/df/skip-duplicates.sh: Likewise.
Fixes http://bugs.gnu.org/17863

tests/df/no-mtab-status.sh
tests/df/skip-duplicates.sh

index f2fda5e656df32a7e2ac2e56c1be63fc035cfde8..9ea2036dddf319a3f4690004dc2190ef3bb67910 100755 (executable)
@@ -23,6 +23,12 @@ require_gcc_shared_
 
 df || skip_ "df fails"
 
+grep '^#define HAVE_MNTENT_H 1' $CONFIG_HEADER > /dev/null \
+      || skip_ "no mntent.h available to confirm the interface"
+
+grep '^#define HAVE_GETMNTENT 1' $CONFIG_HEADER > /dev/null \
+      || skip_ "getmntent is not used on this system"
+
 # Simulate "mtab" failure.
 cat > k.c <<'EOF' || framework_failure_
 #include <stdio.h>
index 9f0f749fef97aa6f884a40818cb5a94c21d51d98..52b9014a366324f9201fbb5fbe48fd6eccbc1eeb 100755 (executable)
@@ -28,6 +28,12 @@ df --local || skip_ "df fails"
 export CU_NONROOT_FS=$(df --local --output=target 2>&1 | grep /. | head -n1)
 test -z "$CU_NONROOT_FS" && unique_entries=1 || unique_entries=2
 
+grep '^#define HAVE_MNTENT_H 1' $CONFIG_HEADER > /dev/null \
+      || skip_ "no mntent.h available to confirm the interface"
+
+grep '^#define HAVE_GETMNTENT 1' $CONFIG_HEADER > /dev/null \
+      || skip_ "getmntent is not used on this system"
+
 # Simulate an mtab file to test various cases.
 cat > k.c <<'EOF' || framework_failure_
 #include <stdio.h>