diff options
author | Josh Blum | 2013-03-17 15:47:30 -0700 |
---|---|---|
committer | Josh Blum | 2013-03-17 15:47:30 -0700 |
commit | c70c996658138d0f38a1670f073cc327ff5ab920 (patch) | |
tree | 21a869c9df27675f8ef2552746b2109cbdd14a84 /tests/CMakeLists.txt | |
parent | f637a4081cef9d28d98e209efbd02099c56777a9 (diff) | |
download | sandhi-c70c996658138d0f38a1670f073cc327ff5ab920.tar.gz sandhi-c70c996658138d0f38a1670f073cc327ff5ab920.tar.bz2 sandhi-c70c996658138d0f38a1670f073cc327ff5ab920.zip |
gras: property tweaks and c++ unit tests
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 27a2965..23a834e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,6 +4,38 @@ include(GrTest) +######################################################################## +# unit test suite +######################################################################## +find_package(Boost COMPONENTS unit_test_framework) + +if (NOT Boost_FOUND) + return() +endif() + +set(test_sources + block_props_test.cpp +) + +include_directories(${GRAS_INCLUDE_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) + +#turn each test cpp file into an executable with an int main() function +add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) + +#for each source: build an executable, register it as a test +foreach(test_source ${test_sources}) + get_filename_component(test_name ${test_source} NAME_WE) + add_executable(${test_name} ${test_source}) + target_link_libraries(${test_name} ${Boost_LIBRARIES} ${GRAS_LIBRARIES}) + set(GR_TEST_LIBRARY_DIRS ${Boost_LIBRARY_DIRS}) + GR_ADD_TEST(${test_name} ${test_name}) +endforeach(test_source) + +######################################################################## +# Python unit tests +######################################################################## include(GrPython) set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}) |