commit:     66c893e7e073006d9b437ed1b5d24644d4a384af
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat May 18 15:16:54 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May 18 15:32:16 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=66c893e7

test-functions: Fix spurious edo() test failures

Portage amends PATH in such a way that "ebuild-helper" utilities can be
found. One of those is a die utility. What purpose that can serve is
presently unclear to me. In any case, it was impeding the declaration of
the die() function provided by gentoo-functions. Address it by setting
PATH to a sane, generic value prior to sourcing the functions for
testing.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 test-functions | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/test-functions b/test-functions
index 0dea9f3..0c0bb45 100755
--- a/test-functions
+++ b/test-functions
@@ -451,17 +451,19 @@ printf 'TAP version 13\n'
 
 unset -v dir
 
+# PATH is redefined to prevent ebuild-helpers such as die from interfering.
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+export TEST_GENFUNCS=1
+export TZ=UTC
+testnum=0
+rc=0
+
 if ! . ./functions.sh; then
        bailout "Couldn't source ./functions.sh"
 fi
 
 assign_tmpdir
 
-export TEST_GENFUNCS=1
-export TZ=UTC
-testnum=0
-rc=0
-
 test_chdir || rc=1
 test_chdir_noop || rc=1
 ( test_ebegin ) || rc=1; testnum=$((testnum + 1))

Reply via email to