From 5a5cf267b75c66e5b7a442b1d7222227312972e6 Mon Sep 17 00:00:00 2001 From: Akatsuki Rui <3736910+akiirui@users.noreply.github.com> Date: Wed, 22 Feb 2023 01:44:59 +0800 Subject: [PATCH] cmake/Tests.cmake: Fix failure in cargo test (#9603) The FISH_RUST_TARGET_DIR is not set for Tests.cmake, the target_dir will set to $CARGO_MANIFEST_DIR/target. But if build.target-dir or CARGO_TARGET_DIR is set, the real target_dir doesn't at the $CARGO_MANIFEST_DIR/target. It causes failure in cargo test. Then, set --target-dir for cargo test. Closes #9600 --- cmake/Tests.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index b8b511ded..cfaae13b9 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -179,7 +179,7 @@ endforeach(PEXPECT) # Rust stuff. add_test( NAME "cargo-test" - COMMAND cargo test + COMMAND cargo test --target-dir target WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/fish-rust" ) set_tests_properties("cargo-test" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE}) @@ -187,7 +187,7 @@ add_test_target("cargo-test") add_test( NAME "cargo-test-widestring" - COMMAND cargo test + COMMAND cargo test --target-dir target WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/fish-rust/widestring-suffix/" ) add_test_target("cargo-test-widestring")