mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
* 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:
parent
ff7fbc9431
commit
bc18ba7e49
@ -107,6 +107,7 @@ endmacro(ei_add_test_internal)
|
|||||||
#
|
#
|
||||||
# Again, ctest -R allows to run all matching tests.
|
# Again, ctest -R allows to run all matching tests.
|
||||||
macro(ei_add_test testname)
|
macro(ei_add_test testname)
|
||||||
|
set(cmake_tests_list "${cmake_tests_list}${testname}\n")
|
||||||
file(READ "${testname}.cpp" test_source)
|
file(READ "${testname}.cpp" test_source)
|
||||||
set(parts 0)
|
set(parts 0)
|
||||||
string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+"
|
string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+"
|
||||||
|
@ -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 "CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n")
|
||||||
ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags: ${SPARSE_LIBS}\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
22
test/maketests.in
Executable 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
|
@ -9,7 +9,7 @@ magenta='\E[35m'
|
|||||||
cyan='\E[36m'
|
cyan='\E[36m'
|
||||||
white='\E[37m'
|
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 $red Test $1 failed: $black
|
||||||
echo -e $blue
|
echo -e $blue
|
||||||
cat .runtest.log
|
cat .runtest.log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user