mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
improve the scripts for building unit tests:
* support unsupported/ * use egrep instead of grep, properly escape special chars.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
get_property(EIGEN_TESTS_LIST GLOBAL PROPERTY EIGEN_TESTS_LIST)
|
||||
configure_file(buildtests.in ${CMAKE_BINARY_DIR}/buildtests)
|
||||
|
||||
configure_file(check.in ${CMAKE_BINARY_DIR}/check)
|
||||
configure_file(debug.in ${CMAKE_BINARY_DIR}/debug)
|
||||
configure_file(release.in ${CMAKE_BINARY_DIR}/release)
|
||||
|
||||
24
scripts/buildtests.in
Executable file
24
scripts/buildtests.in
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# == 0 -o $# -ge 3 ]
|
||||
then
|
||||
echo "usage: ./buildtests regexp [jobs]"
|
||||
echo " makes tests matching the regexp, with [jobs] concurrent make jobs"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TESTSLIST="${EIGEN_TESTS_LIST}"
|
||||
|
||||
targets_to_make=`echo "$TESTSLIST" | egrep "$1" | sed s/^/test_/g | xargs echo`
|
||||
|
||||
if [ $# == 1 ]
|
||||
then
|
||||
make $targets_to_make
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $# == 2 ]
|
||||
then
|
||||
make -j $2 $targets_to_make
|
||||
exit $?
|
||||
fi
|
||||
@@ -4,9 +4,9 @@
|
||||
if [ $# == 0 -o $# -ge 3 ]
|
||||
then
|
||||
echo "usage: ./check regexp [jobs]"
|
||||
echo " makes and runs tests matching the regexp, with <jobs> concurrent make jobs"
|
||||
echo " makes and runs tests matching the regexp, with [jobs] concurrent make jobs"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# TODO when ctest 2.8 comes out, honor the jobs parameter
|
||||
./buildtests $* && ctest -R $1
|
||||
./buildtests "$1" "$2" && ctest -R "$1"
|
||||
|
||||
Reference in New Issue
Block a user