summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--libcr_ipc/CMakeLists.txt9
2 files changed, 4 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 386b13c..c7bf993 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,7 @@ function(add_lib_test arg_libname arg_testname)
if (ENABLE_TESTS)
add_executable("${arg_testname}" "tests/${arg_testname}.c")
target_link_libraries("${arg_testname}" "${arg_libname}")
+ target_include_directories("${arg_testname}" PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
add_test(
NAME "${arg_libname}/${arg_testname}"
COMMAND valgrind --error-exitcode=2 "./${arg_testname}"
diff --git a/libcr_ipc/CMakeLists.txt b/libcr_ipc/CMakeLists.txt
index 4590bdd..3746584 100644
--- a/libcr_ipc/CMakeLists.txt
+++ b/libcr_ipc/CMakeLists.txt
@@ -21,9 +21,6 @@ set(ipc_tests
rpc
sema
)
-if (ENABLE_TESTS)
- foreach(test IN LISTS ipc_tests)
- add_lib_test(libcr_ipc "test_${test}")
- target_include_directories("test_${test}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests)
- endforeach()
-endif()
+foreach(test IN LISTS ipc_tests)
+ add_lib_test(libcr_ipc "test_${test}")
+endforeach()