From 82a1f3c7d7ec93ad44dff3431e193479d8afe914 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Tue, 20 Feb 2024 15:04:02 +0000 Subject: [PATCH] fix(test/libsinsp_e2e): correctly manage cmake deps Signed-off-by: Roberto Scolaro --- test/libsinsp_e2e/CMakeLists.txt | 40 ++-------------------- test/libsinsp_e2e/resources/CMakeLists.txt | 12 ++----- 2 files changed, 5 insertions(+), 47 deletions(-) diff --git a/test/libsinsp_e2e/CMakeLists.txt b/test/libsinsp_e2e/CMakeLists.txt index 7cc7b96e43..c535fbf5f0 100755 --- a/test/libsinsp_e2e/CMakeLists.txt +++ b/test/libsinsp_e2e/CMakeLists.txt @@ -54,10 +54,11 @@ target_include_directories(libsinsp_e2e_tests ) add_executable(test_helper test_helper.cpp) - target_link_libraries(test_helper pthread) +add_dependencies(libsinsp_e2e_tests test_helper) add_executable(vtidcollision vtidcollision.c) +add_dependencies(libsinsp_e2e_tests vtidcollision) execute_process( COMMAND "uname" "-m" @@ -70,46 +71,11 @@ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64") add_executable(test_helper_32 test_helper.cpp) set_target_properties(test_helper_32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") - install( - TARGETS test_helper_32 - DESTINATION ${CMAKE_INSTALL_PREFIX}/test - COMPONENT libsinsp_e2e_tests - ) target_link_libraries(test_helper_32 pthread) + add_dependencies(libsinsp_e2e_tests test_helper_32) endif() endif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") -install( - DIRECTORY - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/captures - COMPONENT libsinsp_e2e_tests -) - -install( - DIRECTORY - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/resources/run - COMPONENT libsinsp_e2e_tests -) - -install( - TARGETS test_helper vtidcollision - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/ - COMPONENT libsinsp_e2e_tests -) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_helper.sh ${CMAKE_CURRENT_BINARY_DIR}/test_helper.sh COPYONLY ) - -install( - FILES test_helper.sh - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/ - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ - COMPONENT libsinsp_e2e_tests -) - -install( - TARGETS libsinsp_e2e_tests - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/ - COMPONENT libsinsp_e2e_tests -) diff --git a/test/libsinsp_e2e/resources/CMakeLists.txt b/test/libsinsp_e2e/resources/CMakeLists.txt index d8f71a246b..2dc6faf9cb 100644 --- a/test/libsinsp_e2e/resources/CMakeLists.txt +++ b/test/libsinsp_e2e/resources/CMakeLists.txt @@ -14,20 +14,12 @@ execute_process( if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") add_executable(execve execve.c) - install( - TARGETS execve - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/resources - COMPONENT tests - ) + add_dependencies(libsinsp_e2e_tests execve) # Build 32-bit tests only for architectures where that is supported if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") add_executable(execve32 execve.c) set_target_properties(execve32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") - install( - TARGETS execve32 - DESTINATION ${CMAKE_INSTALL_PREFIX}/test/resources - COMPONENT tests - ) + add_dependencies(libsinsp_e2e_tests execve32) endif() endif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")