Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/compile-library/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ inputs:
runs:
using: "composite"
steps:
- name: Install dependencies for MITM tests
shell: bash
run: uv pip install --system scapy==2.*

- name: Build and test C++ Components (Linux)
if: inputs.os == 'Linux'
shell: bash
run: |
CXX=$(which g++-14) ./scripts/build.sh
sudo ./scripts/test.sh

- name: Build and test C++ Components (Windows)
if: inputs.os == 'Windows'
Expand Down
3 changes: 0 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ cmake --build --preset $BUILD_PRESET

# Install
cmake --install $BUILD_DIR

# Tests
ctest --preset $BUILD_PRESET
15 changes: 15 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -e
#
# This script tests the C++ components.
#
# Usage:
# ./scripts/test.sh

OS="$(uname -s | tr '[:upper:]' '[:lower:]')" # e.g. linux or darwin
ARCH="$(uname -m)" # e.g. x86_64 or arm64

BUILD_DIR="build_${OS}_${ARCH}"
BUILD_PRESET="${OS}-${ARCH}"

# Run tests
ctest --preset $BUILD_PRESET -VV
5 changes: 4 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
set(BUILD_GTEST ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

find_package(Python3 COMPONENTS Development REQUIRED)

# This function compiles, links, and adds a C++ test executable using Google Test.
# It is shared by all test subdirectories.
function(add_test_executable test_name source_file)
Expand All @@ -26,16 +28,17 @@ function(add_test_executable test_name source_file)
CapnProto::capnp
CapnProto::kj
GTest::gtest_main
Python3::Python
)

add_test(NAME ${test_name} COMMAND ${test_name})
endfunction()


if(LINUX OR APPLE)
# This directory fetches Google Test, so it must be included first.
add_subdirectory(object_storage)

# Add the new directory for io tests.
add_subdirectory(io/ymq)
add_subdirectory(cpp)
endif()
1 change: 1 addition & 0 deletions tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(ymq)
1 change: 1 addition & 0 deletions tests/cpp/ymq/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_test_executable(test_cc_ymq test_cc_ymq.cpp)
Loading
Loading