]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid skipping by fixing build of shared libraries
authorBernhard Voelker <mail@bernhard-voelker.de>
Sat, 1 Nov 2025 19:32:21 +0000 (20:32 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Tue, 4 Nov 2025 10:33:29 +0000 (11:33 +0100)
Two df(1) tests were skipped (since commit ee367bd38dac), because
the build of the shared library in those tests failed.

  + gcc -Wall -shared --std=gnu99 -fPIC -O2 k.c -o k.so -ldl
  k.c: In function 'open':
  k.c:37:7: error: implicit declaration of function 'streq'; did you \
  mean 'strsep'? [-Wimplicit-function-declaration]
     37 |   if (streq (path, "/proc/self/mountinfo"))
        |       ^~~~~
        |       strsep

Gnulib streq is not available in the tests.

* tests/df/no-mtab-status.sh: Replace "streq" by "0==strcmp" in the
shared library source.
* tests/df/skip-duplicates.sh: Likewise.

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

index 0c2e8982d5d5d24d6311329a087a5693c1d93802..135462393d76742550ba06885d75868064c647a0 100755 (executable)
@@ -28,7 +28,8 @@ 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_
+# Replace gnulib streq as that is not available here.
+sed 's/streq/0==str''cmp/' > k.c <<EOF || framework_failure_
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
index f97f794f54588a7d9043f67e67dce54102ef533f..c839f4e191a8fcf59b57cf942b252fcb8ddd1fa9 100755 (executable)
@@ -38,7 +38,8 @@ 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_
+# Replace gnulib streq as that is not available here.
+sed 's/streq/0==str''cmp/' > k.c <<EOF || framework_failure_
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>