* add maketests script. It is like make but takes a regexp allowing to build selected targets. Next step will be a "mctestr" script doing that and then calling ctest -R.

* in runtest.sh, don't override the default number of repeats. If one thinks the default should be changed, let's change it at the source.
This commit is contained in:
Benoit Jacob 2009-11-11 21:25:21 -05:00
parent ff7fbc9431
commit bc18ba7e49
4 changed files with 25 additions and 2 deletions

View File

@ -107,6 +107,7 @@ endmacro(ei_add_test_internal)
#
# Again, ctest -R allows to run all matching tests.
macro(ei_add_test testname)
set(cmake_tests_list "${cmake_tests_list}${testname}\n")
file(READ "${testname}.cpp" test_source)
set(parts 0)
string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+"

View File

@ -163,4 +163,4 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
ei_add_property(EIGEN_TESTING_SUMMARY "CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n")
ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags: ${SPARSE_LIBS}\n")
configure_file(maketests.in ${CMAKE_BINARY_DIR}/maketests)

22
test/maketests.in Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
if [ $# == 0 -o $# -ge 3 ]
then
echo "usage: ./maketests regexp [jobs]"
echo " makes tests matching the regexp, with <jobs> concurrent make jobs"
exit 0
fi
SRCDIR=${CMAKE_CURRENT_SOURCE_DIR}
TESTSLIST="${cmake_tests_list}"
targets_to_make=`echo "$TESTSLIST" | grep "$1" | sed s/^/test_/g | xargs`
if [ $# == 1 ]
then
make $targets_to_make
fi
if [ $# == 2 ]
then
make -j $2 $targets_to_make
fi

View File

@ -9,7 +9,7 @@ magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
if ! ./test_$1 r20 > /dev/null 2> .runtest.log ; then
if ! ./test_$1 > /dev/null 2> .runtest.log ; then
echo -e $red Test $1 failed: $black
echo -e $blue
cat .runtest.log