Skip to content
Snippets Groups Projects
Commit 41730655 authored by Ben Cumming's avatar Ben Cumming Committed by GitHub
Browse files

Merge pull request #46 from eth-cscs/feature/refactor_tests_directory

Feature/refactor tests directory
parents 74a86464 bc8c890d
No related branches found
No related tags found
No related merge requests found
Showing
with 77 additions and 63 deletions
set(HEADERS
../src/cell.hpp
../src/cell_tree.hpp
../src/math.hpp
../src/point.hpp
../src/segment.hpp
../src/swcio.hpp
../src/tree.hpp
)
# google test framework
add_library(gtest gtest-all.cpp gtest.h)
add_library(gtest gtest-all.cpp)
# tests look for gtest.h here
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(TEST_SOURCES
# unit tests
test_algorithms.cpp
test_cell.cpp
test_compartments.cpp
test_event_queue.cpp
test_fvm.cpp
test_cell_group.cpp
test_matrix.cpp
test_mechanisms.cpp
test_optional.cpp
test_parameters.cpp
test_point.cpp
test_probe.cpp
test_segment.cpp
test_spikes.cpp
test_stimulus.cpp
test_swcio.cpp
test_synapses.cpp
test_tree.cpp
test_uninitialized.cpp
# unit test driver
test.cpp
)
# Unit tests
add_subdirectory(unit)
set(VALIDATION_SOURCES
# unit tests
validate_ball_and_stick.cpp
validate_soma.cpp
#validate_synapses.cpp
# Test validating models, possebly needing other software installed
add_subdirectory(validation)
# unit test driver
validate.cpp
)
# Test for the internode communication (eg. mpi)
add_subdirectory(global_communication)
add_definitions("-DDATADIR=\"${CMAKE_SOURCE_DIR}/data\"")
add_executable(test.exe ${TEST_SOURCES} ${HEADERS})
add_executable(validate.exe ${VALIDATION_SOURCES} ${HEADERS})
set(TARGETS test.exe validate.exe)
# Proposed additional test types:
foreach(target ${TARGETS})
target_link_libraries(${target} LINK_PUBLIC cellalgo gtest)
# Large test, employing the full simulator. validated using deltas on output data
if(WITH_TBB)
target_link_libraries(${target} LINK_PUBLIC ${TBB_LIBRARIES})
endif()
# Test to check integration between components
if(WITH_MPI)
target_link_libraries(${target} LINK_PUBLIC ${MPI_C_LIBRARIES})
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "${MPI_C_LINK_FLAGS}")
endif()
# Tests for performance: This could include stand alone tests. These do not necessarily be run automatically
set_target_properties(${target}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
)
endforeach()
# Numbered tests based on bugs in the tracker
# Nothing to be done yet
File moved
set(HEADERS
${PROJECT_SOURCE_DIR}/src/cell.hpp
${PROJECT_SOURCE_DIR}/src/cell_tree.hpp
${PROJECT_SOURCE_DIR}/src/math.hpp
${PROJECT_SOURCE_DIR}/src/point.hpp
${PROJECT_SOURCE_DIR}/src/segment.hpp
${PROJECT_SOURCE_DIR}/src/swcio.hpp
${PROJECT_SOURCE_DIR}/src/tree.hpp
)
set(TEST_SOURCES
# unit tests
test_algorithms.cpp
test_cell.cpp
test_compartments.cpp
test_event_queue.cpp
test_fvm.cpp
test_cell_group.cpp
test_matrix.cpp
test_mechanisms.cpp
test_optional.cpp
test_parameters.cpp
test_point.cpp
test_probe.cpp
test_segment.cpp
test_spikes.cpp
test_stimulus.cpp
test_swcio.cpp
test_synapses.cpp
test_tree.cpp
test_uninitialized.cpp
# unit test driver
test.cpp
)
add_definitions("-DDATADIR=\"${CMAKE_SOURCE_DIR}/data\"")
add_executable(test.exe ${TEST_SOURCES} ${HEADERS})
set(TARGETS test.exe)
foreach(target ${TARGETS})
target_link_libraries(${target} LINK_PUBLIC cellalgo gtest)
if(WITH_TBB)
target_link_libraries(${target} LINK_PUBLIC ${TBB_LIBRARIES})
endif()
if(WITH_MPI)
target_link_libraries(${target} LINK_PUBLIC ${MPI_C_LIBRARIES})
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "${MPI_C_LINK_FLAGS}")
endif()
set_target_properties(${target}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
)
endforeach()
File moved
......@@ -3,7 +3,7 @@
#include "gtest.h"
#include "algorithms.hpp"
#include "util.hpp"
#include "../test_util.hpp"
#include "util/debug.hpp"
......
File moved
File moved
File moved
File moved
#include <fstream>
#include "gtest.h"
#include "util.hpp"
#include "../test_util.hpp"
#include <cell.hpp>
#include <fvm_cell.hpp>
......
File moved
File moved
File moved
#include <fstream>
#include "gtest.h"
#include "util.hpp"
#include "../test_util.hpp"
#include "../src/parameter_list.hpp"
......
File moved
File moved
File moved
File moved
File moved
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment