Simon Josefsson wrote: > Bruno Haible <br...@clisp.org> writes: >> Simon Josefsson wrote: >>> diff --git a/tests/test-xalloc-die.sh b/tests/test-xalloc-die.sh >>> index 03bad60..80d6208 100755 >>> --- a/tests/test-xalloc-die.sh >>> +++ b/tests/test-xalloc-die.sh >>> @@ -18,7 +18,7 @@ >>> >>> . "${srcdir=.}/init.sh"; path_prepend_ . >>> >>> -test-xalloc-die 2> err > out >>> +test-xalloc-die${EXEEXT} 2> err > out >>> case $? in >>> 1) ;; >>> *) Exit 1;; >> >> Under which circumstances is this needed? Jim said in [1]: >> "there's no more need for the $EXE suffix, >> since we're using PATH." > > Is PATH sufficient for cross-compiled MinGW? Anyway here is how to > trigger the problem: > > j...@mocca:~/src/gnulib master$ rm -rf m && gnulib-tool --create-testdir > --dir m --with-tests pread && cd m && ./configure --host=i586-mingw32msvc > --build=i686-pc-linux-gnu && make check > ... > ./test-pread.sh: line 5: test-pread: command not found > FAIL: test-pread.sh
I didn't account for that use case. I wonder if there is some way to write/use a command-not-found handler to automate the error-prone "add-$EXE-suffix" at run-time. If at all possible, I would like to avoid the invasive change of adding the $EXE suffix to every just-built-binary invocation in every test script. If the $EXE suffix is not required in that particular case, an alternative would be to create a temporary directory, D, and populate it with links of the form program ->../.../program.exe (or simply copies, if ln isn't an option) and then prepend "D:" to PATH.