* tests/init.sh (compare_) [MSys]: Use a temporary file on MSYS2.
* tests/test-update-copyright.sh: Use the test framework.
(compare): Remove function.
* modules/update-copyright-tests (Depends-on): Add test-framework-sh.
+2024-12-22 Bruno Haible <bruno@clisp.org>
+
+ test-framework-sh: Avoid test suite failures on MSYS2.
+ * tests/init.sh (compare_) [MSys]: Use a temporary file on MSYS2.
+ * tests/test-update-copyright.sh: Use the test framework.
+ (compare): Remove function.
+ * modules/update-copyright-tests (Depends-on): Add test-framework-sh.
+
2024-12-22 Bruno Haible <bruno@clisp.org>
test-framework-sh: Avoid test suite failures on MSYS2.
tests/test-update-copyright.sh
Depends-on:
+test-framework-sh
configure.ac:
abs_aux_dir=`cd "$ac_aux_dir"; pwd`
done
if test "$diff_opt_" != no; then
if test -z "$diff_out_"; then
- compare_ () { LC_ALL=C diff $diff_opt_ "$@"; }
+ # diff on msys2 does not support the '-' argument for denoting stdin.
+ case `(uname -o) 2>/dev/null` in
+ Msys)
+ compare_ ()
+ {
+ if test " $1" = " -"; then
+ cat > '(stdin)'
+ LC_ALL=C diff $diff_opt_ '(stdin)' "$2"
+ elif test " $2" = " -"; then
+ cat > '(stdin)'
+ LC_ALL=C diff $diff_opt_ "$1" '(stdin)'
+ else
+ LC_ALL=C diff $diff_opt_ "$@"
+ fi
+ }
+ ;;
+ *)
+ compare_ ()
+ {
+ LC_ALL=C diff $diff_opt_ "$@"
+ }
+ esac
else
compare_ ()
{
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-diffout=`diff -u /dev/null /dev/null 2>&1`
-if test x"$diffout" = x"" && test $? -eq 0; then
- compare() { diff -u "$@"; }
-else
- compare() { cmp "$@"; }
-fi
+. "${srcdir=.}/init.sh"; path_prepend_ .
# Ensure the update-copyright program gets found.
PATH=$abs_aux_dir:$PATH