]> granicus.if.org Git - check/commitdiff
use variable OUTPUT_FILE for tests that check logging output
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 17 Dec 2013 16:07:11 +0000 (16:07 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 17 Dec 2013 16:07:11 +0000 (16:07 +0000)
This is better than hard coding the name throghout the test

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@884 64e312b2-a51f-0410-8e61-82d0ca0eb02a

tests/test_log_output.sh
tests/test_xml_output.sh

index e06b4fa50954b183e86dd4dc6bb40b45debe4620..eab83af581a44a6ad0574e98511b8b633ea5cf66 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+OUTPUT_FILE=test.log
+
 . ./test_vars
 
 if [ x"${SRCDIR}" != x"." ]; then
@@ -30,7 +32,7 @@ fi
 test_log_output ( ) {
     
     ./ex_log_output${EXEEXT} "${1}" > /dev/null
-    actual=`cat test.log | tr -d "\r"`
+    actual=`cat ${OUTPUT_FILE} | tr -d "\r"`
     if [ x"${expected}" != x"${actual}" ]; then
        echo "Problem with ex_log_output${EXEEXT} ${1}";
        echo "Expected:";
index 6d640983bd5568d00c5c198004b065ad8379b9e7..c0e4d22e249c2755ad47c32bad3407e3234eea8f 100755 (executable)
@@ -152,9 +152,9 @@ if [ x"${expected_xml}" != x"${actual_xml}" ]; then
     exit 1;
 fi
 
-actual_duration_count=`grep -c \<duration\> test.log.xml`
+actual_duration_count=`grep -c \<duration\> ${OUTPUT_FILE}`
 if [ x"${expected_duration_count}" != x"${actual_duration_count}" ]; then
-    echo "Wrong number of <duration> elements in test.log.xml, ${expected_duration_count} vs ${actual_duration_count}";
+    echo "Wrong number of <duration> elements in ${OUTPUT_FILE}, ${expected_duration_count} vs ${actual_duration_count}";
     exit 1;
 fi