From 52fb5c7c8286b4f03c8b51a179c0e27e04f4d2a8 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Fri, 12 Apr 2013 16:31:07 +0200 Subject: [PATCH] make the tests run for cross-compiled windows when compiling with mingw .exe must be added to the binaries and cmp will find difference in the line endings when running those binaries under wine, so use diff instead there. --- tests/test-defs.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test-defs.sh b/tests/test-defs.sh index 658a75d..15cb5b8 100755 --- a/tests/test-defs.sh +++ b/tests/test-defs.sh @@ -47,7 +47,7 @@ cd "$testsubdir" \ echo "=== Running test $progname" -CMP="${CMP-cmp}" +DIFF="${DIFF-diff}" use_valgrind=${USE_VALGRIND-1} valgrind_path=$(which valgrind 2> /dev/null) @@ -86,6 +86,10 @@ run_output_test() REDIR_OUTPUT="| tee \"${TEST_OUTPUT}.out\"" fi + if [ -f ${top_builddir}/${TEST_COMMAND}.exe ]; then + TEST_COMMAND=${TEST_COMMAND}.exe + fi + if [ $use_valgrind -eq 1 ] ; then eval valgrind --tool=memcheck \ --trace-children=yes \ @@ -114,9 +118,9 @@ run_output_test() fi fi - if ! "$CMP" -s "${top_builddir}/${TEST_OUTPUT}.expected" "${TEST_OUTPUT}.out" ; then + if ! "$DIFF" -w "${top_builddir}/${TEST_OUTPUT}.expected" "${TEST_OUTPUT}.out" ; then echo "ERROR: \"${TEST_COMMAND} $@\" (${TEST_OUTPUT}) failed (set VERBOSE=1 to see full output):" 1>&2 - (cd "${CURDIR}" ; set -x ; diff "${top_builddir}/${TEST_OUTPUT}.expected" "$testsubdir/${TEST_OUTPUT}.out") + (cd "${CURDIR}" ; set -x ; diff -wu "${top_builddir}/${TEST_OUTPUT}.expected" "$testsubdir/${TEST_OUTPUT}.out") echo "cp \"$testsubdir/${TEST_OUTPUT}.out\" \"${top_builddir}/${TEST_OUTPUT}.expected\"" 1>&2 err=1