This is to check for the case where the duration is not -1
or in [0, CK_DEFAULT_TIMEOUT]. There was an issue with NO_FORK
mode where the duration was not valid.
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@927
64e312b2-a51f-0410-8e61-
82d0ca0eb02a
#!/bin/sh
OUTPUT_FILE=test.log.xml
+CK_DEFAULT_TIMEOUT=4
. ./test_vars
fi
rm -f ${OUTPUT_FILE}
+export CK_DEFAULT_TIMEOUT
./ex_xml_output${EXEEXT} > /dev/null
actual_xml=`cat ${OUTPUT_FILE} | tr -d "\r" | grep -v \<duration\> | grep -v \<datetime\> | grep -v \<path\>`
if [ x"${expected_xml}" != x"${actual_xml}" ]; then
exit 1;
fi
+for duration in `grep "\<duration\>" ${OUTPUT_FILE} | cut -d ">" -f 2 | cut -d "<" -f 1`; do
+int_duration=`echo -n $duration | cut -d "." -f 1`
+if [ "${int_duration}" -ne "-1" ] && [ "${int_duration}" -gt "${CK_DEFAULT_TIMEOUT}" ]; then
+ echo "Problem with duration ${duration}; is not valid. Should be -1 or in [0, ${CK_DEFAULT_TIMEOUT}]"
+ exit 1
+fi
+done
+
+
exit 0