Skip to content
Snippets Groups Projects
Commit 1c82dfbe authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

And therefore, no more need for FuTestMacros.cmake

parent 624a7e19
No related branches found
No related tags found
No related merge requests found
Showing
with 16 additions and 29 deletions
......@@ -44,7 +44,6 @@ include(SearchInstalledSoftware)
include(CheckCompiler)
include(BornAgainConfiguration)
include(GeneratePythonDocs)
include(FuTestMacros)
include(GoogletestWrapper)
include(CheckExamples)
include(CheckCode)
......@@ -58,9 +57,9 @@ if(BORNAGAIN_MANPAGE)
endif()
add_subdirectory(ThirdParty)
add_subdirectory(Core)
#add_subdirectory(Tests/UnitTests/Core)
add_subdirectory(Tests/UnitTests/Core)
add_subdirectory(Fit)
#add_subdirectory(Tests/UnitTests/Fit)
add_subdirectory(Tests/UnitTests/Fit)
if(BORNAGAIN_GUI)
add_subdirectory(GUI)
add_subdirectory(Tests/UnitTests/GUI)
......
......@@ -50,7 +50,7 @@ set(test_cases
)
# Other tests:
set(other_executables
set(other_tests
BatchSimulation
PolDWBAMagCylinders2
)
......@@ -69,14 +69,16 @@ if(MSVC)
endif()
# Setup CoreSuite:
BORNAGAIN_EXECUTABLE(CoreSuite LOCATION CoreSuite LIBRARIES BornAgainCore)
add_executable(CoreSuite CoreSuite.cpp)
target_link_libraries(CoreSuite BornAgainCore)
foreach(test_case ${test_cases})
add_test(CoreSuite/${test_case} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreSuite ${test_case})
endforeach()
# Setup other tests:
foreach(exe ${other_executables})
BORNAGAIN_EXECUTABLE(${exe} LOCATION ${exe} LIBRARIES BornAgainCore)
add_test(${exe} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${exe})
foreach(test ${other_tests})
add_executable(${test} ${test}.cpp)
target_link_libraries(${test} BornAgainFit BornAgainCore)
add_test(${test} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test})
endforeach()
Collection of functional tests (C++)
Collection contains functional tests for BornAgainCore library.
Each test defines simple geometry, runs simulation and then compare results of the simulation with reference data.
Tests are compiled and executed automatically when user builds the whole project with 'check' target
cmake; make check
......@@ -27,7 +27,8 @@ include_directories(
${GSL_INCLUDE_DIR}
)
BORNAGAIN_EXECUTABLE(FitSuite LOCATION FitSuite LIBRARIES BornAgainFit BornAgainCore)
add_executable(FitSuite FitSuite.cpp)
target_link_libraries(FitSuite BornAgainFit BornAgainCore)
foreach(test_case ${test_cases})
add_test(FitSuite/${test_case} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FitSuite ${test_case})
endforeach()
......@@ -68,7 +68,8 @@ include_directories(
${GSL_INCLUDE_DIR}
)
BORNAGAIN_EXECUTABLE(GUISuite LOCATION GUISuite LIBRARIES BornAgainCore BornAgainGUI)
add_executable(GUISuite GUISuite.cpp)
target_link_libraries(GUISuite BornAgainCore BornAgainGUI)
qt5_use_modules(GUISuite Widgets Core Gui Designer PrintSupport Network)
foreach(test_case ${test_cases})
add_test(GUISuite/${test_case} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/GUISuite ${test_case})
......
......@@ -57,7 +57,8 @@ include_directories(
${GSL_INCLUDE_DIR}
)
BORNAGAIN_EXECUTABLE(PySuite LOCATION PySuite LIBRARIES BornAgainCore)
add_executable(PyDump PyDump.cpp)
target_link_libraries(PyDump BornAgainCore)
foreach(test_case ${test_cases})
add_test(PySuite/${test_case} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/PySuite ${test_case})
add_test(PyDump/${test_case} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/PyDump ${test_case})
endforeach()
# -----------------------------------------------------------------------------
# BORNAGAIN_EXECUTABLE( executable LOCATION location LIBRARIES libraries )
# -----------------------------------------------------------------------------
function(BORNAGAIN_EXECUTABLE executable)
cmake_parse_arguments(ARG "" "LOCATION" "LIBRARIES" "" ${ARGN})
file(GLOB source_files ${ARG_LOCATION}/*.cpp)
add_executable(${executable} ${source_files})
target_link_libraries(${executable} ${ARG_LIBRARIES})
endfunction()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment