commit e8da6c412759282e41c232887b3c9e4bdb3362e3 from: Thomas Adam date: Sun Jul 10 16:21:31 2022 UTC portable: regress: harden coreutils check When running tests on non-Linux systems, it was just assumed that GNU coreutils had been installed. This meant that the wrapper commands for date/ln on those systems always had gdate and gln installed. Rather than assume that, check to see if the GNU coreutils versions as present, and if not echo a warning. commit - d3b82051e9673733a447d3fec7d1326f0a87e359 commit + e8da6c412759282e41c232887b3c9e4bdb3362e3 blob - bb9bd21c2d5ec4fe19b2d095d3158a0378eeda74 blob + aeeec236c1e8cacf0f4e79bacfe984922683324f --- .github/README.md +++ .github/README.md @@ -33,18 +33,21 @@ FreeBSD: * `automake` * `pkgconf` +* `GNU coreutils` (for running tests) NetBSD: * `automake` * `libuuid` * `ncuresesw` +* `GNU coreutils` (for running tests) DragonFlyBSD: * `automake` * `pkgconf` * `openssl` +* `GNU coreutils` (for running tests) Darwin (MacOS): @@ -65,7 +68,8 @@ To run the test suite: ``` NOTE: For Linux, you must have the jot(1) command which is typically in the -`athena-jot` package, or similar. +`athena-jot` package, or similar. For non-linux systems (as mentioned above), +GNU Coreutils needs to be installed. NOTE: THIS ONLY WORKS AFTER `make install` DUE TO HOW PATHS TO LIBEXEC HELPERS ARE HARD-CODED INTO THE BINARIES. blob - e93af9a213477448ec0c365ed750f357c33d0c7b blob + 507dea0ffedce4ab0986ab8cd955ccd529f814fc --- README.portable +++ README.portable @@ -30,18 +30,21 @@ FreeBSD: * `automake` * `pkgconf` +* `GNU coreutils` (for running tests) NetBSD: * `automake` * `libuuid` * `ncuresesw` +* `GNU coreutils` (for running tests) DragonFlyBSD: * `automake` * `pkgconf` * `openssl` +* `GNU coreutils` (for running tests) Darwin (MacOS): @@ -51,6 +54,7 @@ Darwin (MacOS): * `ncurses` * `openssl` * `ossp-uuid` +* `GNU coreutils` (for running tests) TESTS (REGRESS) =============== @@ -62,7 +66,8 @@ To run the test suite: ``` NOTE: For Linux, you must have the jot(1) command which is typically in the -`athena-jot` package, or similar. +`athena-jot` package, or similar. For non-linux systems (as mentioned above), +GNU coreutils needs to be installed. NOTE: THIS ONLY WORKS AFTER `make install` DUE TO HOW PATHS TO LIBEXEC HELPERS ARE HARD-CODED INTO THE BINARIES. blob - b8e636eaaecf687d7abff3f6badf821737540e70 blob + ef2b0f3c387cedf01c4142429355093055130d4a --- regress/cmdline/common.sh +++ regress/cmdline/common.sh @@ -37,16 +37,26 @@ export MALLOC_OPTIONS=S date() { DATECMD="date" - [ "$PLATFORM" != "linux" ] && DATECMD="gdate" - + [ "$PLATFORM" != "linux" ] && { + command -v "gdate" >/dev/null 2>&1 && { + DATECMD="gdate" + } || { + echo "Couldn't find `gdate` is GNU coreutils installed?" + } + } command "$DATECMD" "$@" } ln() { LNCMD="ln" - [ "$PLATFORM" != "linux" ] && LNCMD="gln" - + [ "$PLATFORM" != "linux" ] && { + command -v "gln" >/dev/null 2>&1 && { + LNCMD="gln" + } || { + echo "Couldn't find `gln` is GNU coreutils installed?" + } + } command "$LNCMD" "$@" }