aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-11-25 21:26:37 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-11-25 21:26:37 -0500
commit5923bcb1b94cd5a79dfc57f2ffe6271d999ea67d (patch)
tree8b4d720e2e271a1d22b7d1eb3435846b284ec952 /scripts
parentf795681da0fec9cd8a56f6987c903ec9a530d509 (diff)
improve the scripts for building unit tests:
* support unsupported/ * use egrep instead of grep, properly escape special chars.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/CMakeLists.txt3
-rwxr-xr-xscripts/buildtests.in24
-rwxr-xr-xscripts/check.in4
3 files changed, 29 insertions, 2 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index b75e99d5e..acf3bb6e9 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -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)
diff --git a/scripts/buildtests.in b/scripts/buildtests.in
new file mode 100755
index 000000000..1cc8e956f
--- /dev/null
+++ b/scripts/buildtests.in
@@ -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
diff --git a/scripts/check.in b/scripts/check.in
index 2a862fd80..ff3c96441 100755
--- a/scripts/check.in
+++ b/scripts/check.in
@@ -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 \ No newline at end of file
+./buildtests "$1" "$2" && ctest -R "$1"