Skip to content

Commit

Permalink
chore(tests): rename new libsinsp_e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Feb 6, 2024
1 parent 9a32ccb commit 77e5a6b
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
26 changes: 13 additions & 13 deletions test/libsinsp/CMakeLists.txt → test/libsinsp_e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ 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
sys_call_test.cpp
)

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`
Expand Down Expand Up @@ -80,15 +80,15 @@ 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)
set_target_properties(test_helper_32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
install(
TARGETS test_helper_32
DESTINATION ${CMAKE_INSTALL_PREFIX}/test
COMPONENT tests
COMPONENT libsinsp_e2e_tests
)
target_link_libraries(test_helper_32 pthread)
endif()
Expand All @@ -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(
Expand All @@ -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
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 77e5a6b

Please sign in to comment.