Skip to content

Commit

Permalink
chore: only build ia32 test on x86_64 arch.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Oct 3, 2023
1 parent da1d5b0 commit 934f776
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Install deps ⛓️
command: |
sudo apt update -y
sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends ca-certificates cmake build-essential git pkg-config autoconf automake libelf-dev libcap-dev linux-headers-$(uname -r) clang-14 llvm-14 gcc-multilib g++-multilib
sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends ca-certificates cmake build-essential git pkg-config autoconf automake libelf-dev libcap-dev linux-headers-$(uname -r) clang-14 llvm-14
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 90
sudo update-alternatives --install /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-14 90
git clone https://github.com/libbpf/bpftool.git --branch v7.0.0 --single-branch
Expand Down
18 changes: 12 additions & 6 deletions test/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,21 @@ set(DRIVERS_TEST_LINK_LIBRARIES
"${GTEST_MAIN_LIB}"
)

add_executable(ia32 ./helpers/ia32.c)
set_target_properties(ia32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")

set(DRIVERS_TEST_DEPENDECIES
scap
gtest
ia32
scap
gtest
)

## IA32 tests are only available on x86_64
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
add_executable(ia32 ./helpers/ia32.c)
set_target_properties(ia32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
set(DRIVERS_TEST_DEPENDECIES
${DRIVERS_TEST_DEPENDECIES}
ia32
)
endif()

add_executable(drivers_test ${DRIVERS_TEST_SOURCES})
target_include_directories(drivers_test ${DRIVERS_TEST_INCLUDE})
target_link_libraries(drivers_test ${DRIVERS_TEST_LINK_LIBRARIES})
Expand Down
2 changes: 2 additions & 0 deletions test/drivers/test_suites/actions_suite/ia32.cpp.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../../event_class/event_class.h"

#if defined(__x86_64__)
TEST(Actions, ia32)
{
/* Here we capture all syscalls... this process will send some
Expand Down Expand Up @@ -46,3 +47,4 @@ TEST(Actions, ia32)
evt_test->assert_event_presence(ret_pid, PPME_SOCKET_ACCEPT4_6_E);
evt_test->assert_event_presence(ret_pid, PPME_SOCKET_ACCEPT4_6_X);
}
#endif

0 comments on commit 934f776

Please sign in to comment.