From 327aa964e9fbf8cadfcfdb307b246b8a1727678a Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 11 Dec 2024 17:04:44 +0100 Subject: [PATCH] Disable default features for `cargo test` Unfortunately it does not appear like #[cfg(test)] works for build.rs? Investigating a better solution, but this is a good idea anyway (or `make test` would generate man pages via build.rs!) --- cmake/Tests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index 5d2099aa3..374f96726 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -155,7 +155,7 @@ endif() add_test( NAME "cargo-test" - COMMAND env ${VARS_FOR_CARGO} cargo test ${CARGO_FLAGS} --workspace --target-dir ${rust_target_dir} ${cargo_test_flags} + COMMAND env ${VARS_FOR_CARGO} cargo test --no-default-features ${CARGO_FLAGS} --workspace --target-dir ${rust_target_dir} ${cargo_test_flags} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) set_tests_properties("cargo-test" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})