Small refactor of cmake for simulator test
This commit is contained in:
parent
24128e0bca
commit
38ca430713
@ -4,7 +4,7 @@ find_package(gflags)
|
||||
|
||||
add_custom_target(memgraph__simulation)
|
||||
|
||||
function(add_simulation_test test_cpp)
|
||||
function(add_simulation_test test_cpp san)
|
||||
# get exec name (remove extension from the abs path)
|
||||
get_filename_component(exec_name ${test_cpp} NAME_WE)
|
||||
set(target_name ${test_prefix}${exec_name})
|
||||
@ -13,19 +13,17 @@ function(add_simulation_test test_cpp)
|
||||
# used to help create two targets of the same name even though CMake
|
||||
# requires unique logical target names
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${exec_name})
|
||||
target_link_libraries(${target_name} gtest gmock gtest_main)
|
||||
target_link_libraries(${target_name} gtest gmock gtest_main mg-utils mg-io-v3)
|
||||
|
||||
# sanitize?
|
||||
target_compile_options(${target_name} PRIVATE -fsanitize=address)
|
||||
target_link_options(${target_name} PRIVATE -fsanitize=address)
|
||||
target_compile_options(${target_name} PRIVATE -fsanitize=${san})
|
||||
target_link_options(${target_name} PRIVATE -fsanitize=${san})
|
||||
|
||||
# register test
|
||||
add_test(${target_name} ${exec_name})
|
||||
add_dependencies(memgraph__simulation ${target_name})
|
||||
endfunction(add_simulation_test)
|
||||
|
||||
add_simulation_test(future.cpp)
|
||||
target_link_libraries(${test_prefix}future mg-utils mg-io-v3)
|
||||
add_simulation_test(future.cpp address)
|
||||
|
||||
add_simulation_test(basic_request.cpp)
|
||||
target_link_libraries(${test_prefix}basic_request mg-utils mg-io-v3)
|
||||
add_simulation_test(basic_request.cpp address)
|
||||
|
Loading…
Reference in New Issue
Block a user