From 3402bc48c614d88694282fa41cd2a15a6f2492a3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 19 Sep 2026 11:18:59 +0200 Subject: [PATCH] GnuTests: skip getopt_vs_usage.sh and usage_vs_refs.patch, of little value for us --- util/build-gnu.sh | 6 +----- util/gnu-patches/series | 2 ++ util/gnu-patches/tests_getopt_vs_usage.patch | 18 ++++++++++++++++++ util/gnu-patches/tests_usage_vs_refs.patch | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 util/gnu-patches/tests_getopt_vs_usage.patch create mode 100644 util/gnu-patches/tests_usage_vs_refs.patch diff --git a/util/build-gnu.sh b/util/build-gnu.sh index bb2448b28bf..2b276a8411d 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -4,7 +4,7 @@ # spell-checker:ignore (paths) abmon deref discrim eacces getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW # spell-checker:ignore baddecode submodules xstrtol distros ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) greadlink gsed multihardlink texinfo CARGOFLAGS -# spell-checker:ignore openat TOCTOU CFLAGS tmpfs gnproc +# spell-checker:ignore openat TOCTOU CFLAGS tmpfs gnproc autoreconf set -e @@ -291,10 +291,6 @@ sed -i "s|# Independent of whether SELinux|return 0\n #|g" init.cfg # making it too restrictive for us sed -i "s|\$PACKAGE_VERSION|[0-9]*|g" tests/rm/fail-2eperm.sh tests/mv/sticky-to-xpart.sh init.cfg -# usage_vs_refs.sh checks that all options appear in GNU's texi docs. -# we have some extra options -sed -i '1s/^/Exit 77\n/' tests/misc/usage_vs_refs.sh - # usage_vs_getopt.sh is heavily modified as it runs all the binaries # with the option -/ is used, clap is returning a better error than GNU's. Adjust the GNU test sed -i -e "s~ grep \" '\*/'\*\" err || framework_failure_~ grep \" '*-/'*\" err || framework_failure_~" tests/misc/usage_vs_getopt.sh diff --git a/util/gnu-patches/series b/util/gnu-patches/series index f9b7fd8262e..96e46b7eb97 100644 --- a/util/gnu-patches/series +++ b/util/gnu-patches/series @@ -12,3 +12,5 @@ test_mkdir_restorecon.patch error_msg_uniq.diff tests_numfmt.patch tests_pwd-long.patch +tests_getopt_vs_usage.patch +tests_usage_vs_refs.patch diff --git a/util/gnu-patches/tests_getopt_vs_usage.patch b/util/gnu-patches/tests_getopt_vs_usage.patch new file mode 100644 index 00000000000..3a0bf1a19fc --- /dev/null +++ b/util/gnu-patches/tests_getopt_vs_usage.patch @@ -0,0 +1,18 @@ +Skip getopt_vs_usage.sh: it takes the option tables from GNU's own src/*.c and +greps our --help for each entry. There is little value in that here - every +option is covered individually by our own tests, and our --help is worded and +laid out differently from GNU's anyway. + +Index: gnu/tests/misc/getopt_vs_usage.sh +=================================================================== +--- gnu.orig/tests/misc/getopt_vs_usage.sh ++++ gnu/tests/misc/getopt_vs_usage.sh +@@ -18,6 +18,8 @@ + + . "${srcdir=.}/tests/init.sh"; + ++skip_ 'options are covered individually by our own tests' ++ + getopts() { + sed -n '/long_*opt.*\[/,/^}/{/^ *{/p}' "$abs_top_srcdir/src/$1.c" | + grep -Ev "(\"-|Deprecated|Obsolescent|Not in $1)" diff --git a/util/gnu-patches/tests_usage_vs_refs.patch b/util/gnu-patches/tests_usage_vs_refs.patch new file mode 100644 index 00000000000..d372c30b788 --- /dev/null +++ b/util/gnu-patches/tests_usage_vs_refs.patch @@ -0,0 +1,18 @@ +Skip usage_vs_refs.sh: it cross-checks every option printed by --help against +references in GNU's doc/coreutils.texi. That manual is not part of this +implementation, so the test can only ever report our own options (-V, uptime +--pretty, hostname --fqdn, ...) as undocumented. + +Index: gnu/tests/misc/usage_vs_refs.sh +=================================================================== +--- gnu.orig/tests/misc/usage_vs_refs.sh ++++ gnu/tests/misc/usage_vs_refs.sh +@@ -18,6 +18,8 @@ + + . "${srcdir=.}/tests/init.sh"; + ++skip_ 'options are documented outside doc/coreutils.texi' ++ + + getopts() { + skip='--help|--version' # These refs treated specially