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
|
||||
PLATFORM=no-platform
|
||||
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
|
||||
rm -f "$ERRORFILE"
|
||||
|
|
@ -111,12 +117,17 @@ run_local_cgal_test()
|
|||
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=$?
|
||||
if [ $exit_value -ne 0 ]
|
||||
then
|
||||
printf "%s\n" "$exit_value" > test_failure
|
||||
fi
|
||||
return $exit_value
|
||||
}
|
||||
|
||||
#test_directory <directory> <already_here>
|
||||
|
|
@ -152,12 +163,27 @@ test_directory()
|
|||
export PLATFORM TESTSUITE_CXXFLAGS TESTSUITE_LDFLAGS
|
||||
rm -f error.txt
|
||||
START=`date +%s`
|
||||
run_local_cgal_test &
|
||||
|
||||
TIME_PERIOD=1200
|
||||
if [ "$1" = "Polyhedron_Demo" ]; then
|
||||
TIME_PERIOD=2400
|
||||
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"
|
||||
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" >> "$ERROR_OUTPUT"
|
||||
fi
|
||||
fi
|
||||
STOP=`date +%s`
|
||||
DURATION=`expr "$STOP" - "$START"`
|
||||
printf " # Running time: %s (seconds)\n\n" "$DURATION" >> "$ERRORFILE"
|
||||
|
|
@ -232,4 +259,3 @@ else
|
|||
fi
|
||||
|
||||
run_testsuite
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue