Adding tests at test root
Couldn't get tests in subdirectores to work so adding them at test root instead.
This commit is contained in:
@@ -47,7 +47,7 @@ script:
|
|||||||
- cmake --build .
|
- cmake --build .
|
||||||
# run unit tests
|
# run unit tests
|
||||||
- cd tests
|
- cd tests
|
||||||
- ctest test
|
- ctest --output-on-failure
|
||||||
# run regression tests
|
# run regression tests
|
||||||
- cd $EPANET_HOME
|
- cd $EPANET_HOME
|
||||||
- pip install -r tools/requirements.txt
|
- pip install -r tools/requirements.txt
|
||||||
|
|||||||
@@ -28,12 +28,11 @@
|
|||||||
cmake_minimum_required (VERSION 2.8.8)
|
cmake_minimum_required (VERSION 2.8.8)
|
||||||
|
|
||||||
project(EPANET)
|
project(EPANET)
|
||||||
include(CTest)
|
|
||||||
|
|
||||||
# Append local dir to module search path
|
# Append local dir to module search path
|
||||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
option(BUILD_TESTS "Build tests (requires Boost)" OFF)
|
||||||
option(BUILD_PY_LIB "Build library for Python wrapper" OFF)
|
option(BUILD_PY_LIB "Build library for Python wrapper" OFF)
|
||||||
option(BUILD_COVERAGE "Build library for coverage" OFF)
|
option(BUILD_COVERAGE "Build library for coverage" OFF)
|
||||||
|
|
||||||
@@ -43,8 +42,8 @@ IF (NOT BUILD_PY_LIB)
|
|||||||
ENDIF (NOT BUILD_PY_LIB)
|
ENDIF (NOT BUILD_PY_LIB)
|
||||||
add_subdirectory(src/outfile)
|
add_subdirectory(src/outfile)
|
||||||
|
|
||||||
IF (BUILD_TESTING)
|
IF (BUILD_TESTS)
|
||||||
#Prep ourselves for compiling boost
|
#Prep ourselves for compiling with boost
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
ELSE(TRUE)
|
ELSE(TRUE)
|
||||||
@@ -59,7 +58,7 @@ IF (BUILD_TESTING)
|
|||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
add_subdirectory(tests/outfile)
|
add_subdirectory(tests/outfile)
|
||||||
add_subdirectory(tests/util)
|
add_subdirectory(tests/util)
|
||||||
ENDIF (BUILD_TESTING)
|
ENDIF (BUILD_TESTS)
|
||||||
|
|
||||||
|
|
||||||
# Sets for output directory for executables and libraries.
|
# Sets for output directory for executables and libraries.
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ before_test:
|
|||||||
test_script:
|
test_script:
|
||||||
# run unit tests
|
# run unit tests
|
||||||
- cd %BUILD_HOME%\tests
|
- cd %BUILD_HOME%\tests
|
||||||
- ctest -C Release RUN_TESTS
|
- ctest -C Release --output-on-failure
|
||||||
# run regression tests
|
# run regression tests
|
||||||
- cd %EPANET_HOME%
|
- cd %EPANET_HOME%
|
||||||
- tools\run-nrtest.cmd %REF_BUILD_ID% %SUT_BUILD_ID%
|
- tools\run-nrtest.cmd %REF_BUILD_ID% %SUT_BUILD_ID%
|
||||||
|
|||||||
@@ -53,3 +53,12 @@ ENDIF(MSVC)
|
|||||||
add_test(NAME test_reent
|
add_test(NAME test_reent
|
||||||
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_reent
|
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_reent
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data)
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data)
|
||||||
|
|
||||||
|
|
||||||
|
# ctest doesn't like tests added in subdirectories so adding them here
|
||||||
|
add_test(NAME test_errormanager
|
||||||
|
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_errormanager)
|
||||||
|
|
||||||
|
add_test(NAME test_output
|
||||||
|
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_output
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data)
|
||||||
|
|||||||
@@ -10,7 +10,3 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|||||||
add_executable(test_output test_output.cpp)
|
add_executable(test_output test_output.cpp)
|
||||||
target_include_directories(test_output PUBLIC ../../src/outfile/include)
|
target_include_directories(test_output PUBLIC ../../src/outfile/include)
|
||||||
target_link_libraries(test_output ${Boost_LIBRARIES} epanet-output)
|
target_link_libraries(test_output ${Boost_LIBRARIES} epanet-output)
|
||||||
|
|
||||||
add_test(NAME test_output
|
|
||||||
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_output
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data)
|
|
||||||
|
|||||||
@@ -15,6 +15,3 @@ set (test_source
|
|||||||
add_executable(test_errormanager ${test_source})
|
add_executable(test_errormanager ${test_source})
|
||||||
target_include_directories(test_errormanager PUBLIC ../../src/)
|
target_include_directories(test_errormanager PUBLIC ../../src/)
|
||||||
target_link_libraries(test_errormanager ${Boost_LIBRARIES})
|
target_link_libraries(test_errormanager ${Boost_LIBRARIES})
|
||||||
|
|
||||||
add_test(NAME test_errormanager
|
|
||||||
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_errormanager)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user