mirror of https://github.com/CGAL/cgal
Merge pull request #4793 from lrineau/Testsuite-rework_the_timeout_of_run_testsuite-GF
Testsuite rework the timeout of run_testsuite
This commit is contained in:
commit
68eab710ee
|
|
@ -21,6 +21,12 @@ if [ -n "$CGAL_TEST_PLATFORM" ]; then
|
||||||
else
|
else
|
||||||
PLATFORM=no-platform
|
PLATFORM=no-platform
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${CGAL_TIMEOUT_PROG+x}" ]; then
|
||||||
|
TIMEOUT=$CGAL_TIMEOUT_PROG
|
||||||
|
else
|
||||||
|
TIMEOUT=`which timeout`
|
||||||
|
[ -z "$TIMEOUT" ] && TIMEOUT=`which gtimeout`
|
||||||
|
fi
|
||||||
|
|
||||||
#clear the error file
|
#clear the error file
|
||||||
rm -f "$ERRORFILE"
|
rm -f "$ERRORFILE"
|
||||||
|
|
@ -111,12 +117,17 @@ run_local_cgal_test()
|
||||||
MAKEFLAGS=
|
MAKEFLAGS=
|
||||||
export MAKEFLAGS
|
export MAKEFLAGS
|
||||||
|
|
||||||
eval ./cgal_test_with_cmake > current_compiler_output 2>&1
|
if [ -n "$TIMEOUT" ]; then
|
||||||
|
"$TIMEOUT" $(( $TIME_PERIOD * 5 )) ./cgal_test_with_cmake > current_compiler_output 2>&1
|
||||||
|
else
|
||||||
|
./cgal_test_with_cmake > current_compiler_output 2>&1
|
||||||
|
fi
|
||||||
exit_value=$?
|
exit_value=$?
|
||||||
if [ $exit_value -ne 0 ]
|
if [ $exit_value -ne 0 ]
|
||||||
then
|
then
|
||||||
printf "%s\n" "$exit_value" > test_failure
|
printf "%s\n" "$exit_value" > test_failure
|
||||||
fi
|
fi
|
||||||
|
return $exit_value
|
||||||
}
|
}
|
||||||
|
|
||||||
#test_directory <directory> <already_here>
|
#test_directory <directory> <already_here>
|
||||||
|
|
@ -152,12 +163,27 @@ test_directory()
|
||||||
export PLATFORM TESTSUITE_CXXFLAGS TESTSUITE_LDFLAGS
|
export PLATFORM TESTSUITE_CXXFLAGS TESTSUITE_LDFLAGS
|
||||||
rm -f error.txt
|
rm -f error.txt
|
||||||
START=`date +%s`
|
START=`date +%s`
|
||||||
run_local_cgal_test &
|
|
||||||
|
|
||||||
TIME_PERIOD=1200
|
TIME_PERIOD=1200
|
||||||
if [ "$1" = "Polyhedron_Demo" ]; then
|
if [ "$1" = "Polyhedron_Demo" ]; then
|
||||||
TIME_PERIOD=2400
|
TIME_PERIOD=2400
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$TIMEOUT" ]; then
|
||||||
|
run_local_cgal_test
|
||||||
|
return_code=$?
|
||||||
|
if [ $return_code -eq 124 ]; then
|
||||||
|
echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERRORFILE"
|
||||||
|
echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERROR_OUTPUT"
|
||||||
|
else
|
||||||
|
if [ -f test_failure ] ; then
|
||||||
|
exit_failure=`cat test_failure`
|
||||||
|
rm -f test_failure
|
||||||
|
echo "ERROR: cgal_test_with_cmake exited with error condition $exit_value" >> "$ERRORFILE"
|
||||||
|
echo "ERROR: cgal_test_with_cmake exited with error condition $exit_value" >> "$ERROR_OUTPUT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
run_local_cgal_test &
|
||||||
|
|
||||||
if wait_for_process "$!" "$TIME_PERIOD" "5"
|
if wait_for_process "$!" "$TIME_PERIOD" "5"
|
||||||
then
|
then
|
||||||
if [ -f test_failure ] ; then
|
if [ -f test_failure ] ; then
|
||||||
|
|
@ -170,6 +196,7 @@ test_directory()
|
||||||
echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERRORFILE"
|
echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERRORFILE"
|
||||||
echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERROR_OUTPUT"
|
echo "ERROR: cgal_test_with_cmake did not finish within the time bound set" >> "$ERROR_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
STOP=`date +%s`
|
STOP=`date +%s`
|
||||||
DURATION=`expr "$STOP" - "$START"`
|
DURATION=`expr "$STOP" - "$START"`
|
||||||
printf " # Running time: %s (seconds)\n\n" "$DURATION" >> "$ERRORFILE"
|
printf " # Running time: %s (seconds)\n\n" "$DURATION" >> "$ERRORFILE"
|
||||||
|
|
@ -232,4 +259,3 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_testsuite
|
run_testsuite
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue