Hi Pádraig, Pádraig Brady <[email protected]> writes:
> On 08/02/2026 11:11, Pádraig Brady wrote: >> Sam, the quickest fix for you is to use bash or skip, >> which is done in the attached. > > I've applied that to the repo actually, > as it will be the easiest patch for packagers to use if needed. > >> The best long term fix for us is to use getsys >> to get the appropriate error text, as I detailed at: >> https://lists.gnu.org/archive/html/coreutils/2026-01/msg00187.html >> We've lots of hacks in the test suite re error messages, >> which this is just another. I'll work on this now. > The attached 2 patches implement and use this > to address the issue at hand. > I'll probably have further patches to rename to getsys, > and to adjust more places in the test suite to use the error strings. > > Marking this as done. In general this looks like a great change. It will save us a lot of time remember which error strings are different on each platform. Just one comment after reviewing the patch. > + /* Errnos */ > + for (int e = 1; e < 256; e++) > + { > + char const *err_name = strerrorname_np (e); > + if (err_name) > + printf ("%s=%s\n", err_name, > + quotearg_style (shell_escape_quoting_style, strerror (e))); > + } I think strerror is okay here, since we set LC_ALL=C in tests/lang-default which is sourced in TESTS_ENVIRONMENT? We don't want translated strings of course since they may not exist or change between platforms (even if they have the same string in English). Second, you might want to use the 'errno-iter' module from Gnulib. It looks a bit safer to me than using a loop over integers 1 - 255. Collin
