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: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Checkout bpfilter
uses: actions/checkout@v2
- name: Configure the build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DNO_BENCHMARKS=1
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build all
run: make -C $GITHUB_WORKSPACE/build -j `nproc`

Expand Down Expand Up @@ -177,7 +177,8 @@ jobs:
BENCH_INCLUDE=""
BENCH_FAIL_ON=""
fi
tools/benchmarks/bfbencher \
tests/benchmarks/bfbencher \
history \
--since 30bd49f \
--until $BENCH_UNTIL \
$BENCH_INCLUDE \
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ make -C build doc
```

**Build options:**
- `-DNO_DOCS=1`, `-DNO_TESTS=1`, `-DNO_CHECKS=1`, `-DNO_BENCHMARKS=1`
- `-DNO_DOCS=1`, `-DNO_TESTS=1`, `-DNO_CHECKS=1`

## Code style

Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ include(GNUInstallDirs)
option(NO_DOCS "Disable documentation generation" 0)
option(NO_TESTS "Disable unit, end-to-end, and integration tests" 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude: suggestion: NO_TESTS now also disables benchmarks (since the benchmark CMake target moved under tests/), but the option description still reads "Disable unit, end-to-end, and integration tests". Users who previously used -DNO_BENCHMARKS independently need to know this. Update to something like "Disable unit, end-to-end, integration tests, and benchmarks".

option(NO_CHECKS "Disable the check target (clang-tidy and clang-format" 0)
option(NO_BENCHMARKS "Disable the benchmark" 0)
option(WITH_COVERAGE "Build with code coverage support. Disabled by default" 0)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -100,7 +99,3 @@ if (NOT ${NO_TESTS})
enable_testing()
add_subdirectory(tests)
endif ()

if (NOT ${NO_BENCHMARKS})
add_subdirectory(tools/benchmarks)
endif ()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sudo dnf install -y bpfilter bpfilter-devel
sudo dnf install -y clang cmake gcc libbpf-devel bison flex sed xxd

# Configure the project and build bpfilter
cmake -S $SOURCES_DIR -B $BUILD_DIR -DNO_DOCS=ON -DNO_TESTS=ON -DNO_CHECKS=ON -DNO_BENCHMARKS=ON
cmake -S $SOURCES_DIR -B $BUILD_DIR -DNO_DOCS=ON -DNO_TESTS=ON -DNO_CHECKS=ON
make -C $BUILD_DIR
```

Expand Down
1 change: 0 additions & 1 deletion derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ in
"-DNO_DOCS=1"
"-DNO_TESTS=1"
"-DNO_CHECKS=1"
"-DNO_BENCHMARKS=1"
];

# We do not run the unit tests because the nix build sandbox doesn't
Expand Down
3 changes: 1 addition & 2 deletions doc/developers/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ You can then use CMake to generate the build system:
The usual CMake options are allowed (e.g. ``CMAKE_BUILD_TYPE``, ``CMAKE_INSTALL_PREFIX``...). The build configuration is modular, so you're free to enable/disable some parts of the projects according to your needs:

- ``-DNO_DOCS``: disable the documentation, including the coverage and benchmarks report.
- ``-DNO_TESTS``: disable unit tests, end-to-end tests, and integration tests.
- ``-DNO_TESTS``: disable all tests.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude: suggestion: The NO_TESTS description was simplified to "disable all tests" which, while technically correct, hides the fact that benchmarks (previously controlled by the now-removed NO_BENCHMARKS) are also disabled. Consider: -DNO_TESTS: disable all tests, including benchmarks." to help users migrating from the old flag.

- ``-DNO_CHECKS``: disable style check and static analyzer.
- ``-DNO_BENCHMARKS``: disable benchmarks.

A full configuration (without any part disabled) will provide the following targets:

Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_subdirectory(e2e)
add_subdirectory(fuzz)
add_subdirectory(integration)
add_subdirectory(check)
add_subdirectory(benchmarks)

add_custom_target(test_bin
DEPENDS unit_bin e2e_bin fuzz_parser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2023 Meta Platforms, Inc. and affiliates.

enable_language(CXX)

find_package(benchmark REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(bpf REQUIRED IMPORTED_TARGET libbpf)
Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading