Adjust the PATH variable for the test setup a bit later, i.e., after 'tests/init.sh' has turned on 'set -x', so that the PATH value appears in the test logfiles.
* init.cfg (fu_path_prepend_): Wrap immediate path_prepend_ call into this new function. * tests/find/debug-missing-arg.sh: Use it - right after sourcing in 'tests/init.sh'. * tests/find/exec-plus-last-file.sh: Likewise. * tests/find/execdir-fd-leak.sh: Likewise. * tests/find/many-dir-entries-vs-OOM.sh: Likewise. * tests/find/name-lbracket-literal.sh: Likewise. * tests/find/printf_escape_c.sh: Likewise. * tests/find/printf_escapechars.sh: Likewise. * tests/find/printf_inode.sh: Likewise. * tests/find/refuse-noop.sh: Likewise. * tests/find/type_list.sh: Likewise. * tests/misc/help-version.sh: Likewise. * tests/sample-test: Likewise. * tests/xargs/verbose-quote.sh: Likewise. --- init.cfg | 5 ++++- tests/find/debug-missing-arg.sh | 2 +- tests/find/exec-plus-last-file.sh | 2 +- tests/find/execdir-fd-leak.sh | 2 +- tests/find/many-dir-entries-vs-OOM.sh | 2 +- tests/find/name-lbracket-literal.sh | 2 +- tests/find/printf_escape_c.sh | 2 +- tests/find/printf_escapechars.sh | 2 +- tests/find/printf_inode.sh | 2 +- tests/find/refuse-noop.sh | 2 +- tests/find/type_list.sh | 2 +- tests/misc/help-version.sh | 2 +- tests/sample-test | 2 +- tests/xargs/verbose-quote.sh | 2 +- 14 files changed, 17 insertions(+), 14 deletions(-) diff --git a/init.cfg b/init.cfg index d4563d5a..55770cbd 100644 --- a/init.cfg +++ b/init.cfg @@ -697,6 +697,9 @@ require_gnu_() } # Prepend all our source directories to PATH. -path_prepend_ "${srcdir=.}/find" "${srcdir=.}/locate" "${srcdir=.}/xargs" +fu_path_prepend_() +{ + path_prepend_ "${srcdir=.}/find" "${srcdir=.}/locate" "${srcdir=.}/xargs" +} sanitize_path_ diff --git a/tests/find/debug-missing-arg.sh b/tests/find/debug-missing-arg.sh index 64ed82cd..3c659527 100755 --- a/tests/find/debug-missing-arg.sh +++ b/tests/find/debug-missing-arg.sh @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # Exercise both find executables. diff --git a/tests/find/exec-plus-last-file.sh b/tests/find/exec-plus-last-file.sh index 352beaa6..0cb05139 100755 --- a/tests/find/exec-plus-last-file.sh +++ b/tests/find/exec-plus-last-file.sh @@ -20,7 +20,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # Require seq(1) for this test - which may not be available diff --git a/tests/find/execdir-fd-leak.sh b/tests/find/execdir-fd-leak.sh index ef9b404c..e365e4e3 100755 --- a/tests/find/execdir-fd-leak.sh +++ b/tests/find/execdir-fd-leak.sh @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # seq is not required by POSIX, so we have manual lists of number here instead. diff --git a/tests/find/many-dir-entries-vs-OOM.sh b/tests/find/many-dir-entries-vs-OOM.sh index 4f0f2f6f..4d044a8e 100755 --- a/tests/find/many-dir-entries-vs-OOM.sh +++ b/tests/find/many-dir-entries-vs-OOM.sh @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # Mark as expensive. diff --git a/tests/find/name-lbracket-literal.sh b/tests/find/name-lbracket-literal.sh index ac2b0326..2d98d1e3 100755 --- a/tests/find/name-lbracket-literal.sh +++ b/tests/find/name-lbracket-literal.sh @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # Prepare a file named '['. diff --git a/tests/find/printf_escape_c.sh b/tests/find/printf_escape_c.sh index 26509c7a..2d8edb15 100755 --- a/tests/find/printf_escape_c.sh +++ b/tests/find/printf_escape_c.sh @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind echo 'hello^.^world' > exp || framework_failure_ diff --git a/tests/find/printf_escapechars.sh b/tests/find/printf_escapechars.sh index 861dd0b0..916bdf54 100755 --- a/tests/find/printf_escapechars.sh +++ b/tests/find/printf_escapechars.sh @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # Check for working od(1). diff --git a/tests/find/printf_inode.sh b/tests/find/printf_inode.sh index 6844268c..2606bd6f 100755 --- a/tests/find/printf_inode.sh +++ b/tests/find/printf_inode.sh @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind make_canonical() { diff --git a/tests/find/refuse-noop.sh b/tests/find/refuse-noop.sh index 856cf2db..4e700f95 100755 --- a/tests/find/refuse-noop.sh +++ b/tests/find/refuse-noop.sh @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # Exercise both the previous name of the pseudo-option '-noop', diff --git a/tests/find/type_list.sh b/tests/find/type_list.sh index e439dfbe..656334f3 100755 --- a/tests/find/type_list.sh +++ b/tests/find/type_list.sh @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ find oldfind # This test is in 'all_root_tests' to get better coverage for file types a diff --git a/tests/misc/help-version.sh b/tests/misc/help-version.sh index ea622421..288f3314 100755 --- a/tests/misc/help-version.sh +++ b/tests/misc/help-version.sh @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ # Terminate any background processes cleanup_() { kill $pid 2>/dev/null && wait $pid; } diff --git a/tests/sample-test b/tests/sample-test index a8ff24d6..546088e9 100644 --- a/tests/sample-test +++ b/tests/sample-test @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ FIXME # FIXME: skip_if_root_ diff --git a/tests/xargs/verbose-quote.sh b/tests/xargs/verbose-quote.sh index 75e3e422..2e8f3f34 100755 --- a/tests/xargs/verbose-quote.sh +++ b/tests/xargs/verbose-quote.sh @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -. "${srcdir=.}/tests/init.sh" +. "${srcdir=.}/tests/init.sh"; fu_path_prepend_ print_ver_ xargs # Prepare a command with a whitespace in its file name. -- 2.23.0