From: brarcher Date: Tue, 5 Nov 2013 02:09:21 +0000 (+0000) Subject: test*_output.sh: append SRCDIR to filenames X-Git-Tag: 0.10.0~358 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=588cb330be30a044fb3031f4f2efe30c197e04f6;p=check test*_output.sh: append SRCDIR to filenames In case check is built out-of-tree, the SRCDIR is appended to filenames. This will prevent a false-positive unit tests failures. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@856 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/tests/test_log_output.sh b/tests/test_log_output.sh index 2ef01a0..e06b4fa 100755 --- a/tests/test_log_output.sh +++ b/tests/test_log_output.sh @@ -2,21 +2,27 @@ . ./test_vars +if [ x"${SRCDIR}" != x"." ]; then + SRCDIR="${SRCDIR}/" +else + SRCDIR="" +fi + if [ $HAVE_FORK -eq 1 ]; then 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 -ex_log_output.c:25:E:Core:test_exit:0: (after this point) Early exit with return value 1 +${SRCDIR}ex_log_output.c:10:P:Core:test_pass:0: Passed +${SRCDIR}ex_log_output.c:16:F:Core:test_fail:0: Failure +${SRCDIR}ex_log_output.c:25:E:Core:test_exit:0: (after this point) Early exit with return value 1 Running suite S2 -ex_log_output.c:34:P:Core:test_pass2:0: Passed +${SRCDIR}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="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 +${SRCDIR}ex_log_output.c:10:P:Core:test_pass:0: Passed +${SRCDIR}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 +${SRCDIR}ex_log_output.c:34:P:Core:test_pass2:0: Passed Results for all suites run: 66%: Checks: 3, Failures: 1, Errors: 0" fi diff --git a/tests/test_output.sh b/tests/test_output.sh index 6ce3098..8199d4b 100755 --- a/tests/test_output.sh +++ b/tests/test_output.sh @@ -2,6 +2,12 @@ . ./test_vars +if [ x"${SRCDIR}" != x"." ]; then + SRCDIR="${SRCDIR}/" +else + SRCDIR="" +fi + t0="x" if [ $HAVE_FORK -eq 1 ]; then @@ -15,25 +21,25 @@ fi if [ $HAVE_FORK -eq 1 ]; then t2="xRunning suite(s): Master 33%: Checks: 3, Failures: 1, Errors: 1 -ex_output.c:17:F:Core:test_fail:0: Failure -ex_output.c:26:E:Core:test_exit:0: (after this point) Early exit with return value 1" +${SRCDIR}ex_output.c:17:F:Core:test_fail:0: Failure +${SRCDIR}ex_output.c:26:E:Core:test_exit:0: (after this point) Early exit with return value 1" else t2="xRunning suite(s): Master 50%: Checks: 2, Failures: 1, Errors: 0 -ex_output.c:17:F:Core:test_fail:0: Failure" +${SRCDIR}ex_output.c:17:F:Core:test_fail:0: Failure" fi if [ $HAVE_FORK -eq 1 ]; then t3="xRunning suite(s): Master 33%: Checks: 3, Failures: 1, Errors: 1 -ex_output.c:11:P:Core:test_pass:0: Passed -ex_output.c:17:F:Core:test_fail:0: Failure -ex_output.c:26:E:Core:test_exit:0: (after this point) Early exit with return value 1" +${SRCDIR}ex_output.c:11:P:Core:test_pass:0: Passed +${SRCDIR}ex_output.c:17:F:Core:test_fail:0: Failure +${SRCDIR}ex_output.c:26:E:Core:test_exit:0: (after this point) Early exit with return value 1" else t3="xRunning suite(s): Master 50%: Checks: 2, Failures: 1, Errors: 0 -ex_output.c:11:P:Core:test_pass:0: Passed -ex_output.c:17:F:Core:test_fail:0: Failure" +${SRCDIR}ex_output.c:11:P:Core:test_pass:0: Passed +${SRCDIR}ex_output.c:17:F:Core:test_fail:0: Failure" fi if [ $HAVE_FORK -eq 1 ]; then @@ -41,18 +47,18 @@ t4="xtest: Core:test_pass success: Core:test_pass test: Core:test_fail failure: Core:test_fail [ -ex_output.c:17: Failure +${SRCDIR}ex_output.c:17: Failure ] test: Core:test_exit error: Core:test_exit [ -ex_output.c:26: (after this point) Early exit with return value 1 +${SRCDIR}ex_output.c:26: (after this point) Early exit with return value 1 ]" else t4="xtest: Core:test_pass success: Core:test_pass test: Core:test_fail failure: Core:test_fail [ -ex_output.c:17: Failure +${SRCDIR}ex_output.c:17: Failure ]" fi