feat(linear-static-3d-euler-beam): step 24 - linear-static-cli
This commit is contained in:
+90
-31
@@ -38,6 +38,42 @@ target_link_libraries(
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_executable(
|
||||
fesa_integration_tests
|
||||
integration/analysis/linear_static_analysis_test.cpp
|
||||
integration/app/fesa_application_test.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
fesa_integration_tests
|
||||
PRIVATE
|
||||
fesa_solver
|
||||
Fesa::HDF5
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_executable(
|
||||
fesa_reference_tests
|
||||
reference/reference_comparison.cpp
|
||||
reference/reference_comparison_test.cpp
|
||||
reference/b33_reference_comparison_test.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
fesa_reference_tests
|
||||
PRIVATE
|
||||
fesa_solver
|
||||
Fesa::HDF5
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
target_compile_definitions(
|
||||
fesa_reference_tests
|
||||
PRIVATE
|
||||
FESA_TEST_SOURCE_DIR="${PROJECT_SOURCE_DIR}"
|
||||
FESA_TEST_BINARY_DIR="${PROJECT_BINARY_DIR}"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(NOT TARGET MKL::mkl_intel_thread OR NOT TARGET MKL::mkl_core OR
|
||||
NOT OMP_DLL_DIR OR NOT OMP_DLLNAME)
|
||||
@@ -54,36 +90,41 @@ if(WIN32)
|
||||
list(SORT _fesa_mkl_dispatch_dlls COMPARE NATURAL ORDER DESCENDING)
|
||||
list(GET _fesa_mkl_dispatch_dlls 0 _fesa_mkl_dispatch_dll)
|
||||
|
||||
# Stage dynamic backend dependencies before post-build GoogleTest
|
||||
# discovery; the exact validation commands do not assume oneAPI in PATH.
|
||||
add_custom_command(
|
||||
TARGET fesa_unit_tests
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_FILE:TBB::tbb>"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_FILE:MKL::mkl_intel_thread>"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_FILE:MKL::mkl_core>"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${OMP_DLL_DIR}/${OMP_DLLNAME}"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${OMP_DLL_DIR}/libmmd.dll"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${_fesa_mkl_dispatch_dll}"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
# Stage runtime DLLs selected through imported targets, including the
|
||||
# normalized HDF5 backend, without naming a package-specific target.
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_RUNTIME_DLLS:fesa_unit_tests>"
|
||||
"$<TARGET_FILE_DIR:fesa_unit_tests>"
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
function(fesa_stage_test_runtime target_name)
|
||||
# Stage dynamic backend dependencies before post-build GoogleTest
|
||||
# discovery; the exact validation commands do not assume oneAPI in PATH.
|
||||
add_custom_command(
|
||||
TARGET "${target_name}"
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_FILE:TBB::tbb>"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_FILE:MKL::mkl_intel_thread>"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_FILE:MKL::mkl_core>"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${OMP_DLL_DIR}/${OMP_DLLNAME}"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${OMP_DLL_DIR}/libmmd.dll"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${_fesa_mkl_dispatch_dll}"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
# Imported-target runtime closure includes the normalized HDF5 DLL.
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"$<TARGET_RUNTIME_DLLS:${target_name}>"
|
||||
"$<TARGET_FILE_DIR:${target_name}>"
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
endfunction()
|
||||
|
||||
fesa_stage_test_runtime(fesa_unit_tests)
|
||||
fesa_stage_test_runtime(fesa_integration_tests)
|
||||
fesa_stage_test_runtime(fesa_reference_tests)
|
||||
|
||||
unset(_fesa_mkl_dispatch_dll)
|
||||
unset(_fesa_mkl_dispatch_dlls)
|
||||
@@ -95,4 +136,22 @@ gtest_discover_tests(
|
||||
LABELS "linear-static-3d-euler-beam;unit"
|
||||
)
|
||||
|
||||
add_custom_target(fesa_tests DEPENDS fesa_unit_tests)
|
||||
gtest_discover_tests(
|
||||
fesa_integration_tests
|
||||
PROPERTIES
|
||||
LABELS "linear-static-3d-euler-beam;integration"
|
||||
)
|
||||
|
||||
gtest_discover_tests(
|
||||
fesa_reference_tests
|
||||
PROPERTIES
|
||||
LABELS "linear-static-3d-euler-beam;reference"
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
fesa_tests
|
||||
DEPENDS
|
||||
fesa_unit_tests
|
||||
fesa_integration_tests
|
||||
fesa_reference_tests
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user