diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 23:15:05 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 23:15:05 -0500 |
commit | ea88ec90b3259844acb270fdbd6dc0920650647e (patch) | |
tree | cbf5d06ba5fe77a0f0d3566db4c4700d1c5de905 | |
parent | 8c959fe3209b6577fc80666bc8ea5d3e5e25c296 (diff) | |
download | horizon-ea88ec90b3259844acb270fdbd6dc0920650647e.tar.gz horizon-ea88ec90b3259844acb270fdbd6dc0920650647e.tar.bz2 horizon-ea88ec90b3259844acb270fdbd6dc0920650647e.tar.xz horizon-ea88ec90b3259844acb270fdbd6dc0920650647e.zip |
CMake: Move tests to their respective target CMakeLists
-rw-r--r-- | CMakeLists.txt | 21 | ||||
-rw-r--r-- | tools/hscript-simulate/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tools/hscript-validate/CMakeLists.txt | 10 |
3 files changed, 21 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f6e555..8221928 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,28 +28,9 @@ IF(COVERAGE) ENDIF(COVERAGE) include_directories(.) +enable_testing() add_subdirectory(hscript) IF(BUILD_TOOLS) add_subdirectory(tools) ENDIF(BUILD_TOOLS) - -enable_testing() -IF(BUILD_TOOLS) - add_test(NAME "RSpecValidator" - COMMAND rspec spec/validator.rb - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) - set_property(TEST "RSpecValidator" - PROPERTY ENVIRONMENT "PATH=$PATH:${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-validate") - add_test(NAME "RSpecSimulator" - COMMAND rspec spec/simulator.rb - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) - set_property(TEST "RSpecSimulator" - PROPERTY ENVIRONMENT "PATH=$PATH:${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-simulate") - IF(VALGRIND) - add_test(NAME "ValgrindValidator" - COMMAND valgrind ${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-validate/hscript-validate tests/fixtures/0001-basic.installfile) - add_test(NAME "ValgrindSimulator" - COMMAND valgrind ${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-simulate/hscript-simulate tests/fixtures/0001-basic.installfile) - ENDIF(VALGRIND) -ENDIF(BUILD_TOOLS) diff --git a/tools/hscript-simulate/CMakeLists.txt b/tools/hscript-simulate/CMakeLists.txt index a8dfda8..439563b 100644 --- a/tools/hscript-simulate/CMakeLists.txt +++ b/tools/hscript-simulate/CMakeLists.txt @@ -5,3 +5,13 @@ add_executable(hscript-simulate ${SIMULATOR_SRCS}) target_link_libraries(hscript-simulate hscript) install(TARGETS hscript-simulate DESTINATION bin) + +add_test(NAME "RSpecSimulator" + COMMAND rspec spec/simulator.rb + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) +set_property(TEST "RSpecSimulator" + PROPERTY ENVIRONMENT "PATH=$PATH:${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-simulate") +IF(VALGRIND) +add_test(NAME "ValgrindSimulator" + COMMAND valgrind ${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-simulate/hscript-simulate tests/fixtures/0001-basic.installfile) +ENDIF(VALGRIND) diff --git a/tools/hscript-validate/CMakeLists.txt b/tools/hscript-validate/CMakeLists.txt index 7ae6e52..07fec53 100644 --- a/tools/hscript-validate/CMakeLists.txt +++ b/tools/hscript-validate/CMakeLists.txt @@ -5,3 +5,13 @@ add_executable(hscript-validate ${VALIDATE_SRCS}) target_link_libraries(hscript-validate hscript) install(TARGETS hscript-validate DESTINATION bin) + +add_test(NAME "RSpecValidator" + COMMAND rspec spec/validator.rb + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) +set_property(TEST "RSpecValidator" + PROPERTY ENVIRONMENT "PATH=$PATH:${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-validate") +IF(VALGRIND) +add_test(NAME "ValgrindValidator" + COMMAND valgrind ${CMAKE_CURRENT_BINARY_DIR}/tools/hscript-validate/hscript-validate tests/fixtures/0001-basic.installfile) +ENDIF(VALGRIND) |