diff --git a/CMakeLists.txt b/CMakeLists.txt index 766a910714e..a1944c58400 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ option(MUSL_OPTIMIZED_BUILD "Enable if you want a musl optimized build" OFF) option(USE_BUNDLED_DRIVER "Use the driver/ subdirectory in the build process (only available in Linux)" ON) option(ENABLE_DRIVERS_TESTS "Enable driver tests (bpf, kernel module, modern bpf)" OFF) option(ENABLE_LIBSCAP_TESTS "Enable libscap unit tests" OFF) -option(ENABLE_LIBSINSP_TESTS "Enable libsinsp e2e tests" OFF) +option(ENABLE_LIBSINSP_E2E_TESTS "Enable libsinsp e2e tests" OFF) option(BUILD_SHARED_LIBS "Build libscap and libsinsp as shared libraries" OFF) option(ENABLE_VM_TESTS "Enable driver sanity tests" OFF) @@ -128,9 +128,9 @@ if(CREATE_TEST_TARGETS) add_subdirectory(test/libscap) endif() - if(ENABLE_LIBSINSP_TESTS) - add_subdirectory(test/libsinsp) - add_subdirectory(test/libsinsp/resources) + if(ENABLE_LIBSINSP_E2E_TESTS) + add_subdirectory(test/libsinsp_e2e) + add_subdirectory(test/libsinsp_e2e/resources) endif() if(ENABLE_VM_TESTS) diff --git a/test/libsinsp/CMakeLists.txt b/test/libsinsp_e2e/CMakeLists.txt similarity index 87% rename from test/libsinsp/CMakeLists.txt rename to test/libsinsp_e2e/CMakeLists.txt index fb91f45f83c..91177caafd3 100755 --- a/test/libsinsp/CMakeLists.txt +++ b/test/libsinsp_e2e/CMakeLists.txt @@ -28,7 +28,7 @@ configure_file ( "${CMAKE_CURRENT_BINARY_DIR}/libsinsp_test_var.h" ) -add_executable(tests +add_executable(libsinsp_e2e_tests event_capture.cpp main.cpp subprocess.cpp @@ -36,18 +36,18 @@ add_executable(tests ) if(BUILD_BPF) - add_dependencies(tests driver bpf) + add_dependencies(libsinsp_e2e_tests driver bpf) else() - add_dependencies(tests driver) + add_dependencies(libsinsp_e2e_tests driver) endif() -target_link_libraries(tests +target_link_libraries(libsinsp_e2e_tests sinsp GTest::gtest pthread ) -target_include_directories(tests +target_include_directories(libsinsp_e2e_tests PRIVATE ${PROJECT_BINARY_DIR}/driver/src "${CMAKE_CURRENT_BINARY_DIR}" # used to include `libsinsp_test_var.h` @@ -80,7 +80,7 @@ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/test_helper_32 DESTINATION ${CMAKE_INSTALL_PREFIX}/test - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) else() add_executable(test_helper_32 test_helper.cpp) @@ -88,7 +88,7 @@ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") install( TARGETS test_helper_32 DESTINATION ${CMAKE_INSTALL_PREFIX}/test - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) target_link_libraries(test_helper_32 pthread) endif() @@ -97,19 +97,19 @@ endif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") install( DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/test/captures - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) install( DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/test/resources/run - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) install( TARGETS test_helper vtidcollision DESTINATION ${CMAKE_INSTALL_PREFIX}/test/ - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) configure_file( @@ -120,11 +120,11 @@ install( FILES test_helper.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/test/ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) install( - TARGETS tests + TARGETS libsinsp_e2e_tests DESTINATION ${CMAKE_INSTALL_PREFIX}/test/ - COMPONENT tests + COMPONENT libsinsp_e2e_tests ) diff --git a/test/libsinsp/event_capture.cpp b/test/libsinsp_e2e/event_capture.cpp similarity index 100% rename from test/libsinsp/event_capture.cpp rename to test/libsinsp_e2e/event_capture.cpp diff --git a/test/libsinsp/event_capture.h b/test/libsinsp_e2e/event_capture.h similarity index 100% rename from test/libsinsp/event_capture.h rename to test/libsinsp_e2e/event_capture.h diff --git a/test/libsinsp/libsinsp_test_var.h.in b/test/libsinsp_e2e/libsinsp_test_var.h.in similarity index 100% rename from test/libsinsp/libsinsp_test_var.h.in rename to test/libsinsp_e2e/libsinsp_test_var.h.in diff --git a/test/libsinsp/main.cpp b/test/libsinsp_e2e/main.cpp similarity index 100% rename from test/libsinsp/main.cpp rename to test/libsinsp_e2e/main.cpp diff --git a/test/libsinsp/resources/CMakeLists.txt b/test/libsinsp_e2e/resources/CMakeLists.txt similarity index 100% rename from test/libsinsp/resources/CMakeLists.txt rename to test/libsinsp_e2e/resources/CMakeLists.txt diff --git a/test/libsinsp/resources/execve.c b/test/libsinsp_e2e/resources/execve.c similarity index 100% rename from test/libsinsp/resources/execve.c rename to test/libsinsp_e2e/resources/execve.c diff --git a/test/libsinsp/subprocess.cpp b/test/libsinsp_e2e/subprocess.cpp similarity index 100% rename from test/libsinsp/subprocess.cpp rename to test/libsinsp_e2e/subprocess.cpp diff --git a/test/libsinsp/subprocess.h b/test/libsinsp_e2e/subprocess.h similarity index 100% rename from test/libsinsp/subprocess.h rename to test/libsinsp_e2e/subprocess.h diff --git a/test/libsinsp/sys_call_test.cpp b/test/libsinsp_e2e/sys_call_test.cpp similarity index 100% rename from test/libsinsp/sys_call_test.cpp rename to test/libsinsp_e2e/sys_call_test.cpp diff --git a/test/libsinsp/sys_call_test.h b/test/libsinsp_e2e/sys_call_test.h similarity index 100% rename from test/libsinsp/sys_call_test.h rename to test/libsinsp_e2e/sys_call_test.h diff --git a/test/libsinsp/test_helper.cpp b/test/libsinsp_e2e/test_helper.cpp similarity index 100% rename from test/libsinsp/test_helper.cpp rename to test/libsinsp_e2e/test_helper.cpp diff --git a/test/libsinsp/test_helper.sh b/test/libsinsp_e2e/test_helper.sh similarity index 100% rename from test/libsinsp/test_helper.sh rename to test/libsinsp_e2e/test_helper.sh diff --git a/test/libsinsp/vtidcollision.c b/test/libsinsp_e2e/vtidcollision.c similarity index 100% rename from test/libsinsp/vtidcollision.c rename to test/libsinsp_e2e/vtidcollision.c