Skip to content
Merged
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/test_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ jobs:
- name: Run Rust tests natively via Cargo
run: cargo test
working-directory: bindings/rust
- name: Run Rust tests via CMake target
- name: Run Rust tests via CMake
run: |
cmake -S . -B build -DBENCHMARK_ENABLE_RUST_BINDINGS=ON -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
cmake --build build --target test_rust_bindings
cmake --build build
cd build && ctest -R rust_bindings_tests
8 changes: 6 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,13 @@ endif()

if (BENCHMARK_ENABLE_RUST_BINDINGS)
find_program(CARGO_EXECUTABLE cargo REQUIRED)
add_custom_target(test_rust_bindings ALL
add_custom_target(build_rust_bindings ALL
COMMAND ${CARGO_EXECUTABLE} build --tests
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/bindings/rust
COMMENT "Building Rust bindings and tests"
)
add_test(NAME rust_bindings_tests
COMMAND ${CARGO_EXECUTABLE} test
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/bindings/rust
COMMENT "Running Rust bindings tests"
)
endif()
Loading