Skip to content
Snippets Groups Projects
Commit 449e6f72 authored by Markus Blatt's avatar Markus Blatt
Browse files

- Moved the test definitions to the CMakeLists.txt of the test

  directories. This seems to be more manageable.
- Deactivated building of the test during make all. Seems annoying to
  our users.
- Introduced make check mimicing autotools.

Tests still fail where they should not.

[[Imported from SVN: r6610]]
parent 044574e7
No related branches found
No related tags found
No related merge requests found
......@@ -77,10 +77,25 @@ configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_definitions(-DHAVE_CONFIG_H)
# Create a custom target for building the tests.
# Thus they will not be built by make all any more.
# Actually I wanted this target to be a dependency
# of make test but that is currently not possible.
# See http://public.kitware.com/Bug/view.php?id=8438
# This really sucks!
# Therefore currently make build_tests has to be called
# before make test.
add_custom_target(build_tests DEPENDS ${TESTPROGS})
# mimic make check of the autotools
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS build_tests)
# enable testing before adding the subdirectories.
# Thus we can add the tests in the subdirectories
# where they actually are.
enable_testing()
#add_custom_target(build_test)
set_property(TEST APPEND PROPERTY DEPENDS build_tests)
# add subdirectories to execute CMakeLists.txt there
add_subdirectory("dune")
......@@ -116,96 +131,4 @@ if(PKG_CONFIG_FOUND )
endif(PKG_CONFIG_FOUND)
include(CTest)
# add tests from dune/common/test
add_test(arraylisttest dune/common/test/arraylisttest)
add_test(arraytest dune/common/test/arraytest)
add_test(bigunsignedinttest dune/common/test/bigunsignedinttest)
add_test(bitsetvectortest dune/common/test/bitsetvectortest)
add_test(check_fvector_size dune/common/test/check_fvector_size)
add_test(conversiontest dune/common/test/conversiontest)
add_test(deprtuplestest dune/common/test/deprtuplestest)
add_test(dynmatrixtest dune/common/test/dynmatrixtest)
add_test(dynvectortest dune/common/test/dynvectortest)
add_test(enumsettest dune/common/test/enumsettest)
add_test(fmatrixtest dune/common/test/fmatrixtest)
add_test(fvectortest dune/common/test/fvectortest)
add_test(gcdlcmtest dune/common/test/gcdlcmtest)
add_test(iteratorfacadetest dune/common/test/iteratorfacadetest)
add_test(iteratorfacadetest2 dune/common/test/iteratorfacadetest2)
add_test(lrutest dune/common/test/lrutest)
if(MPI_CXX_FOUND)
add_test(mpicollectivecommunication dune/common/test/mpicollectivecommunication)
endif(MPI_CXX_FOUND)
add_test(mpiguardtest dune/common/test/mpiguardtest)
add_test(mpihelpertest dune/common/test/mpihelpertest)
add_test(mpihelpertest2 dune/common/test/mpihelpertest2)
add_test(nullptr_test dune/common/test/nullptr_test)
add_test(parametertreetest dune/common/test/parametertreetest)
add_test(pathtest dune/common/test/pathtest)
add_test(poolallocatortest dune/common/test/poolallocatortest)
add_test(shared_ptrtest_config dune/common/test/shared_ptrtest_config)
add_test(shared_ptrtest_dune dune/common/test/shared_ptrtest_dune)
add_test(singletontest dune/common/test/singletontest)
add_test(streamtest dune/common/test/streamtest)
add_test(testfassign1 dune/common/test/testfassign1)
add_test(testfassign2 dune/common/test/testfassign2)
add_test(testfassign3 dune/common/test/testfassign3)
add_test(testfassign4 dune/common/test/testfassign4)
add_test(test_stack dune/common/test/test_stack)
add_test(tuplestest_config dune/common/test/tuplestest_config)
add_test(tuplestest_dune dune/common/test/tuplestest_dune)
add_test(tuplestest_tr1 dune/common/test/tuplestest_tr1)
add_test(tupleutilitytest dune/common/test/tupleutilitytest)
add_test(utilitytest dune/common/test/utilitytest)
# failing tests
add_test(testfassign_fail1 dune/common/test/testfassign_fail1)
add_test(testfassign_fail2 dune/common/test/testfassign_fail2)
add_test(testfassign_fail3 dune/common/test/testfassign_fail3)
add_test(testfassign_fail4 dune/common/test/testfassign_fail4)
add_test(testfassign_fail5 dune/common/test/testfassign_fail5)
add_test(testfassign_fail6 dune/common/test/testfassign_fail6)
set_tests_properties(
testfassign_fail1
testfassign_fail2
testfassign_fail3
testfassign_fail4
testfassign_fail5
testfassign_fail6
PROPERTIES WILL_FAIL true)
# compile test
add_test(NAME static_assert_test
COMMAND ${CMAKE_COMMAND} --build . --target static_assert_test --config $<CONFIGURATION>)
add_test(NAME testfconstruct
COMMAND ${CMAKE_COMMAND} --build . --target testfconstruct --config $<CONFIGURATION>)
# failing compile tests
add_test(NAME genericiterator_compile_fail
COMMAND ${CMAKE_COMMAND} --build . --target genericiterator_compile_fail --config $<CONFIGURATION>)
add_test(NAME check_fvector_size_fail1
COMMAND ${CMAKE_COMMAND} --build . --target check_fvector_size_fail1 --config $<CONFIGURATION>)
add_test(NAME check_fvector_size_fail2
COMMAND ${CMAKE_COMMAND} --build . --target check_fvector_size_fail2 --config $<CONFIGURATION>)
add_test(NAME nullptr_test_fail
COMMAND ${CMAKE_COMMAND} --build . --target nullptr_test_fail --config $<CONFIGURATION>)
add_test(NAME static_assert_test_fail
COMMAND ${CMAKE_COMMAND} --build . --target static_assert_test_fail --config $<CONFIGURATION>)
add_test(NAME testfconstruct_fail1
COMMAND ${CMAKE_COMMAND} --build . --target testfconstruct_fail1 --config $<CONFIGURATION>)
add_test(NAME testfconstruct_fail2
COMMAND ${CMAKE_COMMAND} --build . --target testfconstruct_fail2 --config $<CONFIGURATION>)
set_tests_properties(
genericiterator_compile_fail
check_fvector_size_fail1
check_fvector_size_fail2
nullptr_test_fail
static_assert_test_fail
testfconstruct_fail1
testfconstruct_fail2
PROPERTIES WILL_FAIL true)
# add tests from dune/common/parallel/test
add_test(indexsettest dune/common/parallel/test/indexsettest)
add_test(selectiontest dune/common/parallel/test/selectiontest)
if(MPI_CXX_FOUND)
add_test(indicestest dune/common/parallel/test/indicestest)
#add_test(syncertest dune/common/parallel/test/syncertest)
endif(MPI_CXX_FOUND)
add_subdirectory("parallel")
add_subdirectory("test")
add_subdirectory("test" EXCLUDE_FROM_ALL)
#build the library dunecommon
add_library("dunecommon"
......
add_subdirectory("test")
add_subdirectory("test" EXCLUDE_FROM_ALL)
#install headers
install(FILES
......@@ -11,3 +11,10 @@ install(FILES
remoteindices.hh
selection.hh
DESTINATION include/dune/common/parallel)
add_test(indexsettest indexsettest)
add_test(selectiontest selectiontest)
if(MPI_CXX_FOUND)
add_test(indicestest indicestest)
#add_test(syncertest syncertest)
endif(MPI_CXX_FOUND)
set(MPITESTPROGS indicestest indexsettest syncertest selectiontest)
add_dependencies(build_tests ${MPITESTPROGS})
# We do not want want to build the tests during make all,
# but just build them on demand
add_dependencies(build_tests ${MPITESTPROGS})
add_executable("indexsettest" indexsettest.cc)
target_link_libraries("indexsettest" "dunecommon")
......
# Install some test headers, because they get used by tests in other modules
install(FILES iteratortest.hh DESTINATION include/dune/common/test)
set(TESTPROGS
arraylisttest
arraytest
bigunsignedinttest
bitsetvectortest
check_fvector_size
conversiontest
deprtuplestest
dynmatrixtest
dynvectortest
enumsettest
fassigntest
float_cmp
fmatrixtest
fvectortest
gcdlcmtest
iteratorfacadetest
iteratorfacadetest2
lrutest
mpicollcomm
mpiguardtest
mpihelpertest
mpihelpertest2
nullptr-test
pathtest
parametertreetest
poolallocatortest
shared_ptrtest_config
shared_ptrtest_dune
singletontest
static_assert_test
streamtest
test-stack
testfassign1
testfassign2
testfassign3
testfassign4
testfassign_fail1
testfassign_fail2
testfassign_fail3
testfassign_fail4
testfassign_fail5
testfassign_fail6
testfconstruct
tuplestest_dune
tuplestest_std
tuplestest_tr1
tupleutilitytest
utilitytest)
# We do not want want to build the tests during make all,
# but just build them on demand
add_dependencies(build_tests ${TESTPROGS})
# Add the executables needed for the tests
add_executable("arraylisttest" arraylisttest.cc)
add_executable("arraytest" arraytest.cc)
......@@ -130,3 +185,90 @@ add_executable("tuplestest_tr1" tuplestest.cc)
set_target_properties(tuplestest_tr1 PROPERTIES COMPILE_FLAGS "-DDISABLE_STD_TUPLE")
add_executable("tupleutilitytest" tupleutilitytest.cc)
add_executable("utilitytest" utilitytest.cc)
# Add the tests to be executed
add_test(arraylisttest arraylisttest)
add_test(arraytest arraytest)
add_test(bigunsignedinttest bigunsignedinttest)
add_test(bitsetvectortest bitsetvectortest)
add_test(check_fvector_size check_fvector_size)
add_test(conversiontest conversiontest)
add_test(deprtuplestest deprtuplestest)
add_test(dynmatrixtest dynmatrixtest)
add_test(dynvectortest dynvectortest)
add_test(enumsettest enumsettest)
add_test(fmatrixtest fmatrixtest)
add_test(fvectortest fvectortest)
add_test(gcdlcmtest gcdlcmtest)
add_test(iteratorfacadetest iteratorfacadetest)
add_test(iteratorfacadetest2 iteratorfacadetest2)
add_test(lrutest lrutest)
if(MPI_CXX_FOUND)
add_test(mpicollectivecommunication mpicollectivecommunication)
endif(MPI_CXX_FOUND)
add_test(mpiguardtest mpiguardtest)
add_test(mpihelpertest mpihelpertest)
add_test(mpihelpertest2 mpihelpertest2)
add_test(nullptr_test nullptr_test)
add_test(parametertreetest parametertreetest)
add_test(pathtest pathtest)
add_test(poolallocatortest poolallocatortest)
add_test(shared_ptrtest_config shared_ptrtest_config)
add_test(shared_ptrtest_dune shared_ptrtest_dune)
add_test(singletontest singletontest)
add_test(streamtest streamtest)
add_test(testfassign1 testfassign1)
add_test(testfassign2 testfassign2)
add_test(testfassign3 testfassign3)
add_test(testfassign4 testfassign4)
add_test(test_stack test_stack)
add_test(tuplestest_config tuplestest_config)
add_test(tuplestest_dune tuplestest_dune)
add_test(tuplestest_tr1 tuplestest_tr1)
add_test(tupleutilitytest tupleutilitytest)
add_test(utilitytest utilitytest)
# failing tests
add_test(testfassign_fail1 testfassign_fail1)
add_test(testfassign_fail2 testfassign_fail2)
add_test(testfassign_fail3 testfassign_fail3)
add_test(testfassign_fail4 testfassign_fail4)
add_test(testfassign_fail5 testfassign_fail5)
add_test(testfassign_fail6 testfassign_fail6)
set_tests_properties(
testfassign_fail1
testfassign_fail2
testfassign_fail3
testfassign_fail4
testfassign_fail5
testfassign_fail6
PROPERTIES WILL_FAIL true)
# compile test
add_test(NAME static_assert_test
COMMAND ${CMAKE_COMMAND} --build . --target static_assert_test --config $<CONFIGURATION>)
add_test(NAME testfconstruct
COMMAND ${CMAKE_COMMAND} --build . --target testfconstruct --config $<CONFIGURATION>)
# failing compile tests
add_test(NAME genericiterator_compile_fail
COMMAND ${CMAKE_COMMAND} --build . --target genericiterator_compile_fail --config $<CONFIGURATION>)
add_test(NAME check_fvector_size_fail1
COMMAND ${CMAKE_COMMAND} --build . --target check_fvector_size_fail1 --config $<CONFIGURATION>)
add_test(NAME check_fvector_size_fail2
COMMAND ${CMAKE_COMMAND} --build . --target check_fvector_size_fail2 --config $<CONFIGURATION>)
add_test(NAME nullptr_test_fail
COMMAND ${CMAKE_COMMAND} --build . --target nullptr_test_fail --config $<CONFIGURATION>)
add_test(NAME static_assert_test_fail
COMMAND ${CMAKE_COMMAND} --build . --target static_assert_test_fail --config $<CONFIGURATION>)
add_test(NAME testfconstruct_fail1
COMMAND ${CMAKE_COMMAND} --build . --target testfconstruct_fail1 --config $<CONFIGURATION>)
add_test(NAME testfconstruct_fail2
COMMAND ${CMAKE_COMMAND} --build . --target testfconstruct_fail2 --config $<CONFIGURATION>)
set_tests_properties(
genericiterator_compile_fail
check_fvector_size_fail1
check_fvector_size_fail2
nullptr_test_fail
static_assert_test_fail
testfconstruct_fail1
testfconstruct_fail2
PROPERTIES WILL_FAIL true)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment