From: Bruno Haible Date: Mon, 4 Aug 2025 23:20:58 +0000 (+0200) Subject: nlcanon tests: Fix last commit. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5312beab91ecc96211cdc3e5960af6908a2ed2;p=thirdparty%2Fgnulib.git nlcanon tests: Fix last commit. * tests/init.sh (setup_): Revert last change. * modules/test-framework-sh (Makefile.am): Augment TESTS_ENVIRONMENT here. * modules/nlcanon-tests (Makefile.am): Don't augment TESTS_ENVIRONMENT here. --- diff --git a/ChangeLog b/ChangeLog index c9ef6c7cef..ab88105b47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-08-04 Bruno Haible + + nlcanon tests: Fix last commit. + * tests/init.sh (setup_): Revert last change. + * modules/test-framework-sh (Makefile.am): Augment TESTS_ENVIRONMENT + here. + * modules/nlcanon-tests (Makefile.am): Don't augment TESTS_ENVIRONMENT + here. + 2025-08-04 Paul Eggert vma-iter: pacify Coverity Scan diff --git a/modules/nlcanon-tests b/modules/nlcanon-tests index bfcecda38e..23a733e628 100644 --- a/modules/nlcanon-tests +++ b/modules/nlcanon-tests @@ -6,5 +6,3 @@ test-framework-sh Makefile.am: TESTS += test-nlcanon.sh -TESTS_ENVIRONMENT += \ - top_builddir='@top_builddir@' diff --git a/modules/test-framework-sh b/modules/test-framework-sh index 249f426608..2a10d461ff 100644 --- a/modules/test-framework-sh +++ b/modules/test-framework-sh @@ -9,6 +9,12 @@ Depends-on: configure.ac: Makefile.am: +# The value of top_builddir, determined by Autoconf and stored in the Makefile, +# consists of n times '..', where n is the depth of the $(srcdir) under +# $(top_srcdir). Here we need one more '..', because the test framework +# (init.sh) arranges to run the tests in a subdirectory of depth 1 under the +# directory where the Makefile sits. +TESTS_ENVIRONMENT += top_builddir='../@top_builddir@' Include: diff --git a/tests/init.sh b/tests/init.sh index d3ce11dbee..d695020545 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -428,21 +428,13 @@ setup_ () test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ || fail_ "failed to create temporary directory in $initial_cwd_" cd "$test_dir_" || fail_ "failed to cd to temporary directory" - # Set variables srcdir, builddir, and optionally top_builddir, - # for the convenience of the test. + # Set variables srcdir, builddir, for the convenience of the test. case $srcdir in /* | ?:*) ;; *) srcdir="../$srcdir" ;; esac builddir=".." export srcdir builddir - if test -n "$top_builddir"; then - case $top_builddir in - /* | ?:*) ;; - *) top_builddir="../$top_builddir" ;; - esac - export top_builddir - fi # As autoconf-generated configure scripts do, ensure that IFS # is defined initially, so that saving and restoring $IFS works.