From 844d14009dcaaa13807434e4917e941e2bf4cfe8 Mon Sep 17 00:00:00 2001 From: brarcher Date: Fri, 27 Sep 2013 01:38:39 +0000 Subject: [PATCH] test_log_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 encoding, sed is used to remove \r before the check. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@802 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- tests/test_log_output.sh | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/tests/test_log_output.sh b/tests/test_log_output.sh index 94fb2bb..7ff2b6c 100755 --- a/tests/test_log_output.sh +++ b/tests/test_log_output.sh @@ -1,13 +1,5 @@ #!/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. - . ./test_vars if [ $HAVE_FORK -eq 1 ]; then @@ -20,20 +12,19 @@ ex_log_output.c:34:P:Core:test_pass2:0: Passed Results for all suites run: 50%: Checks: 4, Failures: 1, Errors: 1" else -expected=`printf "Running suite S1\r -ex_log_output.c:10:P:Core:test_pass:0: Passed\r -ex_log_output.c:16:F:Core:test_fail:0: Failure\r -Running suite S2\r -ex_log_output.c:34:P:Core:test_pass2:0: Passed\r -Results for all suites run:\r -66%%: Checks: 3, Failures: 1, Errors: 0\r -"` +expected="Running suite S1 +ex_log_output.c:10:P:Core:test_pass:0: Passed +ex_log_output.c:16:F:Core:test_fail:0: Failure +Running suite S2 +ex_log_output.c:34:P:Core:test_pass2:0: Passed +Results for all suites run: +66%: Checks: 3, Failures: 1, Errors: 0" fi test_log_output ( ) { ./ex_log_output${EXEEXT} "${1}" > /dev/null - actual=`cat test.log` + actual=`cat test.log | sed 's/\r//g'` if [ x"${expected}" != x"${actual}" ]; then echo "Problem with ex_log_output${EXEEXT} ${3}"; echo "Expected:"; -- 2.40.0