From: brarcher Date: Fri, 27 Sep 2013 01:38:35 +0000 (+0000) Subject: test_xml_output: removing assumption that HAVE_FORK=0 implied Windows X-Git-Tag: 0.10.0~414 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e55249b0899cb9c92601cb28001a6df82f1e9602;p=check test_xml_output: removing assumption that HAVE_FORK=0 implied Windows With the configuration option --disable-fork, *nix systems can also be compiled without using fork. To fix the line encodings, sed is used to remove \r before the check. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@800 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/tests/test_xml_output.sh b/tests/test_xml_output.sh index 816b4b5..7c7eb71 100755 --- a/tests/test_xml_output.sh +++ b/tests/test_xml_output.sh @@ -1,12 +1,6 @@ #!/bin/sh -# For this test script, it is assumed that HAVE_FORK=0 implies -# running in a Windows environment. That means not only are -# fork-related tests not run, but also line endings are important. -# In *NIX environments line endings are \n, but in Windows they -# are expected to be \r\n. For this reason, HAVE_FORK=0 uses -# printf to generate the comparison strings, so the line endings -# can be controlled. +OUTPUT_FILE=test.log.xml . ./test_vars @@ -87,69 +81,68 @@ expected_duration_count=9 # a -1 for duration, as no duration is known. expected_duration_error=5 else -expected_xml=`printf "\r -\r -\r - \r - S1\r - \r - ex_xml_output.c:10\r - test_pass\r - 0\r - Core\r - Passed\r - \r - \r - ex_xml_output.c:16\r - test_fail\r - 0\r - Core\r - Failure\r - \r - \r - \r - S2\r - \r - ex_xml_output.c:34\r - test_pass2\r - 0\r - Core\r - Passed\r - \r - \r - ex_xml_output.c:40\r - test_loop\r - 0\r - Core\r - Iteration 0 failed\r - \r - \r - ex_xml_output.c:40\r - test_loop\r - 1\r - Core\r - Passed\r - \r - \r - ex_xml_output.c:40\r - test_loop\r - 2\r - Core\r - Iteration 2 failed\r - \r - \r - \r - XML escape " ' < > & tests\r - \r - ex_xml_output.c:46\r - test_xml_esc_fail_msg\r - 0\r - description " ' < > &\r - fail " ' < > & message\r - \r - \r -\r -"` +expected_xml=" + + + + S1 + + ex_xml_output.c:10 + test_pass + 0 + Core + Passed + + + ex_xml_output.c:16 + test_fail + 0 + Core + Failure + + + + S2 + + ex_xml_output.c:34 + test_pass2 + 0 + Core + Passed + + + ex_xml_output.c:40 + test_loop + 0 + Core + Iteration 0 failed + + + ex_xml_output.c:40 + test_loop + 1 + Core + Passed + + + ex_xml_output.c:40 + test_loop + 2 + Core + Iteration 2 failed + + + + XML escape " ' < > & tests + + ex_xml_output.c:46 + test_xml_esc_fail_msg + 0 + description " ' < > & + fail " ' < > & message + + +" expected_duration_count=8 # For no-fork mode, all tests 'finish' and do not call exit(). This means @@ -158,7 +151,7 @@ expected_duration_error=0 fi ./ex_xml_output${EXEEXT} > /dev/null -actual_xml=`cat test.log.xml | grep -v \ | grep -v \ | grep -v \` +actual_xml=`cat ${OUTPUT_FILE} | sed 's/\r//g' | grep -v \ | grep -v \ | grep -v \` if [ x"${expected_xml}" != x"${actual_xml}" ]; then echo "Problem with ex_xml_output${EXEEXT} ${3}"; echo "Expected:";