From 358452bbe6a3fcc8290969dbd531e30701a4c1f2 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 12 Nov 2009 12:07:18 -0500 Subject: * add ./debug and ./release scripts * update the messages * rename EIGEN_CMAKE_RUN_FROM_CTEST to something saner --- CMakeLists.txt | 20 ++++++++++++-------- cmake/EigenTesting.cmake | 9 +++------ scripts/CMakeLists.txt | 4 ++++ scripts/debug.in | 3 +++ scripts/maketests.in | 21 +++++++++++++++++++++ scripts/mctestr.in | 14 ++++++++++++++ scripts/release.in | 3 +++ test/CMakeLists.txt | 3 --- test/maketests.in | 21 --------------------- test/mctestr.in | 14 -------------- test/testsuite.cmake | 2 +- 11 files changed, 61 insertions(+), 53 deletions(-) create mode 100644 scripts/CMakeLists.txt create mode 100755 scripts/debug.in create mode 100755 scripts/maketests.in create mode 100755 scripts/mctestr.in create mode 100755 scripts/release.in delete mode 100755 test/maketests.in delete mode 100755 test/mctestr.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c2fddacc..8bc7d4754 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,11 +131,11 @@ add_subdirectory(doc EXCLUDE_FROM_ALL) include(CTest) enable_testing() # must be called from the root CMakeLists, see man page -if(EIGEN_CMAKE_RUN_FROM_CTEST) +if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest -else(EIGEN_CMAKE_RUN_FROM_CTEST) +else() add_subdirectory(test EXCLUDE_FROM_ALL) -endif(EIGEN_CMAKE_RUN_FROM_CTEST) +endif() add_subdirectory(unsupported) @@ -143,6 +143,8 @@ add_subdirectory(demos EXCLUDE_FROM_ALL) add_subdirectory(blas EXCLUDE_FROM_ALL) +add_subdirectory(scripts EXCLUDE_FROM_ALL) + # TODO: consider also replacing EIGEN_BUILD_BTL by a custom target "make btl"? if(EIGEN_BUILD_BTL) add_subdirectory(bench/btl EXCLUDE_FROM_ALL) @@ -155,16 +157,18 @@ message("Configured Eigen ${EIGEN_VERSION_NUMBER}") string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_tolower) if(cmake_generator_tolower MATCHES "makefile") - message("You can now do the following:") + message("Some things you can do now:") message("--------------+----------------------------------------------------------------") message("Command | Description") message("--------------+----------------------------------------------------------------") message("make install | Install to ${CMAKE_INSTALL_PREFIX}") message(" | * To change that: cmake . -DCMAKE_INSTALL_PREFIX=yourpath") - message("make btest | Build the unit tests") - message("make test | Build and run the unit tests (using CTest)") - message("make test_qr | Build a specific test, here test_qr.") - message("make blas | Build BLAS library (not the same thing as Eigen)") message("make doc | Generate the API documentation, requires Doxygen & LaTeX") + message("make blas | Build BLAS library (not the same thing as Eigen)") message("--------------+----------------------------------------------------------------") endif() + +message("") +message("To build/run the unit tests, read this page:") +message(" http://eigen.tuxfamily.org/index.php?title=Tests") +message("") \ No newline at end of file diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index 3850a1b11..8ed39738d 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -138,15 +138,12 @@ macro(ei_testing_print_summary) message("*** Eigen's unit tests configuration summary ***") message("************************************************************") message("") - message("Build type: ${CMAKE_BUILD_TYPE}") - message(" * To change that: cmake . -DCMAKE_BUILD_TYPE=type") - message(" * Available types are Debug and Release") - message("") + message("Build type: ${CMAKE_BUILD_TYPE}") get_property(EIGEN_TESTING_SUMMARY GLOBAL PROPERTY EIGEN_TESTING_SUMMARY) get_property(EIGEN_TESTED_BACKENDS GLOBAL PROPERTY EIGEN_TESTED_BACKENDS) get_property(EIGEN_MISSING_BACKENDS GLOBAL PROPERTY EIGEN_MISSING_BACKENDS) - message("Enabled backends: ${EIGEN_TESTED_BACKENDS}") - message("Disabled backends: ${EIGEN_MISSING_BACKENDS}") + message("Enabled backends: ${EIGEN_TESTED_BACKENDS}") + message("Disabled backends: ${EIGEN_MISSING_BACKENDS}") if(EIGEN_TEST_SSE2) message("SSE2: ON") diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt new file mode 100644 index 000000000..e373d3188 --- /dev/null +++ b/scripts/CMakeLists.txt @@ -0,0 +1,4 @@ +configure_file(maketests.in ${CMAKE_BINARY_DIR}/maketests) +configure_file(mctestr.in ${CMAKE_BINARY_DIR}/mctestr) +configure_file(debug.in ${CMAKE_BINARY_DIR}/debug) +configure_file(release.in ${CMAKE_BINARY_DIR}/release) diff --git a/scripts/debug.in b/scripts/debug.in new file mode 100755 index 000000000..d339d3d1f --- /dev/null +++ b/scripts/debug.in @@ -0,0 +1,3 @@ +#!/bin/sh + +cmake -DCMAKE_BUILD_TYPE=Debug . diff --git a/scripts/maketests.in b/scripts/maketests.in new file mode 100755 index 000000000..f9cafed26 --- /dev/null +++ b/scripts/maketests.in @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ $# == 0 -o $# -ge 3 ] +then + echo "usage: ./maketests regexp [jobs]" + echo " makes tests matching the regexp, with concurrent make jobs" + exit 0 +fi + +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 diff --git a/scripts/mctestr.in b/scripts/mctestr.in new file mode 100755 index 000000000..a388ef38f --- /dev/null +++ b/scripts/mctestr.in @@ -0,0 +1,14 @@ +#!/bin/bash +# mctestr : shorthand for make and ctest -R + +if [ $# == 0 -o $# -ge 3 ] +then + echo "usage: ./mctestr regexp [jobs]" + echo " makes and runs tests matching the regexp, with concurrent make jobs" + exit 0 +fi + +./maketests $* + +# TODO when ctest 2.8 comes out, honor the jobs parameter +ctest -R $1 \ No newline at end of file diff --git a/scripts/release.in b/scripts/release.in new file mode 100755 index 000000000..db2d9d940 --- /dev/null +++ b/scripts/release.in @@ -0,0 +1,3 @@ +#!/bin/sh + +cmake -DCMAKE_BUILD_TYPE=Release . diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aad1572f7..d0938302f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -162,6 +162,3 @@ if(CMAKE_COMPILER_IS_GNUCXX) 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) -configure_file(mctestr.in ${CMAKE_BINARY_DIR}/mctestr) diff --git a/test/maketests.in b/test/maketests.in deleted file mode 100755 index f9cafed26..000000000 --- a/test/maketests.in +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -if [ $# == 0 -o $# -ge 3 ] -then - echo "usage: ./maketests regexp [jobs]" - echo " makes tests matching the regexp, with concurrent make jobs" - exit 0 -fi - -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 diff --git a/test/mctestr.in b/test/mctestr.in deleted file mode 100755 index a388ef38f..000000000 --- a/test/mctestr.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# mctestr : shorthand for make and ctest -R - -if [ $# == 0 -o $# -ge 3 ] -then - echo "usage: ./mctestr regexp [jobs]" - echo " makes and runs tests matching the regexp, with concurrent make jobs" - exit 0 -fi - -./maketests $* - -# TODO when ctest 2.8 comes out, honor the jobs parameter -ctest -R $1 \ No newline at end of file diff --git a/test/testsuite.cmake b/test/testsuite.cmake index 5d0cb6585..9c38e48b1 100644 --- a/test/testsuite.cmake +++ b/test/testsuite.cmake @@ -148,7 +148,7 @@ endif(NOT EIGEN_NO_UPDATE) # which ctest command to use for running the dashboard SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}") # what cmake command to use for configuring this dashboard -SET (CTEST_CMAKE_COMMAND "${EIGEN_CMAKE_DIR}cmake -DEIGEN_CMAKE_RUN_FROM_CTEST=ON") +SET (CTEST_CMAKE_COMMAND "${EIGEN_CMAKE_DIR}cmake -DEIGEN_LEAVE_TEST_IN_ALL_TARGET=ON") #################################################################### # The values in this section are optional you can either -- cgit v1.2.3