]> granicus.if.org Git - check/commitdiff
test*_output.sh: append SRCDIR to filenames
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 5 Nov 2013 02:09:21 +0000 (02:09 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 5 Nov 2013 02:09:21 +0000 (02:09 +0000)
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

tests/test_log_output.sh
tests/test_output.sh

index 2ef01a05f79bcc3d7693929e645e1fd9fe4e38c6..e06b4fa50954b183e86dd4dc6bb40b45debe4620 100755 (executable)
@@ -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
index 6ce3098e7ff46bc99091e94f2cd53aafa3d9ec53..8199d4b062308568b0164250fc60ddfdcb24b98b 100755 (executable)
@@ -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