]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: env.sh: avoid multi-call binary considerations master
authoroech3 <79379754+oech3@users.noreply.github.com>
Sun, 18 Jan 2026 20:38:15 +0000 (05:38 +0900)
committerPádraig Brady <P@draigBrady.com>
Sun, 18 Jan 2026 21:41:23 +0000 (21:41 +0000)
A simpler fix than commit v9.9-4-g3b6efd555
which is less dependent on the exact behavior
of a multi-call binary.

* tests/env/env.sh: Use a local script rather than 'true'.
which may be a symlinked multi-call binary.
https://github.com/coreutils/coreutils/pull/174

tests/env/env.sh

index 69a1bf8590acb8e6119e857d77d52b90680c4074..d68c11a2254d465423978e6e7bd5cd7bbb4cefba 100755 (executable)
@@ -172,13 +172,16 @@ got=$(env --chdir=empty pwd) || fail=1
 test "$exp" = "$got" || fail=1
 
 # Verify argv0 overriding
+cat <<EOF > truetrue || framework_failure_
+#!$SHELL
+EOF
+chmod +x truetrue || framework_failure_
 for arg in 'argv0' ''; do
-env -v -a short --argv0=$arg true --coreutils-prog=true 2>err || fail=1
+env -v -a short --argv0=$arg ./truetrue 2>err || fail=1
 cat <<EOF >err_exp || framework_failure_
 argv0:     '$arg'
-executing: true
+executing: ./truetrue
    arg[0]= '$arg'
-   arg[1]= '--coreutils-prog=true'
 EOF
 compare err_exp err || fail=1
 done