2018-09-27 21:11:50 +08:00
|
|
|
set(test_prefix memgraph__property_based__)
|
2017-06-30 20:25:25 +08:00
|
|
|
|
2018-09-27 21:11:50 +08:00
|
|
|
add_custom_target(memgraph__property_based)
|
2017-06-30 20:25:25 +08:00
|
|
|
|
2018-09-27 21:11:50 +08:00
|
|
|
function(add_property_based_test test_cpp)
|
2017-06-30 20:25:25 +08:00
|
|
|
# get exec name (remove extension from the abs path)
|
|
|
|
get_filename_component(exec_name ${test_cpp} NAME_WE)
|
2018-09-27 21:11:50 +08:00
|
|
|
set(target_name ${test_prefix}${exec_name})
|
2017-06-30 20:25:25 +08:00
|
|
|
add_executable(${target_name} ${test_cpp})
|
|
|
|
# OUTPUT_NAME sets the real name of a target when it is built and can be
|
|
|
|
# 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})
|
2017-10-03 19:56:41 +08:00
|
|
|
target_link_libraries(${target_name} gtest gtest_main)
|
|
|
|
target_link_libraries(${target_name} rapidcheck rapidcheck_gtest)
|
2019-04-25 19:37:26 +08:00
|
|
|
add_test(${target_name} ${exec_name})
|
2018-09-27 21:11:50 +08:00
|
|
|
add_dependencies(memgraph__property_based ${target_name})
|
|
|
|
endfunction(add_property_based_test)
|
2017-07-01 00:58:44 +08:00
|
|
|
|
2018-09-27 21:11:50 +08:00
|
|
|
add_property_based_test(random_graph.cpp)
|
2020-01-13 17:34:55 +08:00
|
|
|
target_link_libraries(${test_prefix}random_graph mg-storage-v2)
|