Browse Source

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.
pull/80/head
Klas Lindfors 12 years ago
parent
commit
52fb5c7c82
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      tests/test-defs.sh

+ 7
- 3
tests/test-defs.sh View File

@@ -47,7 +47,7 @@ cd "$testsubdir" \


echo "=== Running test $progname" echo "=== Running test $progname"


CMP="${CMP-cmp}"
DIFF="${DIFF-diff}"


use_valgrind=${USE_VALGRIND-1} use_valgrind=${USE_VALGRIND-1}
valgrind_path=$(which valgrind 2> /dev/null) valgrind_path=$(which valgrind 2> /dev/null)
@@ -86,6 +86,10 @@ run_output_test()
REDIR_OUTPUT="| tee \"${TEST_OUTPUT}.out\"" REDIR_OUTPUT="| tee \"${TEST_OUTPUT}.out\""
fi fi


if [ -f ${top_builddir}/${TEST_COMMAND}.exe ]; then
TEST_COMMAND=${TEST_COMMAND}.exe
fi

if [ $use_valgrind -eq 1 ] ; then if [ $use_valgrind -eq 1 ] ; then
eval valgrind --tool=memcheck \ eval valgrind --tool=memcheck \
--trace-children=yes \ --trace-children=yes \
@@ -114,9 +118,9 @@ run_output_test()
fi fi
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 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 echo "cp \"$testsubdir/${TEST_OUTPUT}.out\" \"${top_builddir}/${TEST_OUTPUT}.expected\"" 1>&2


err=1 err=1


Loading…
Cancel
Save