mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 07:04:29 +00:00
test_cargo-test: use Corrosion target dir
This makes "ninja test" write only to the build directory, not to the source tree. This enables our docker script which mounts the source as read-only.
This commit is contained in:
parent
6c2271a6da
commit
2d493621f4
2 changed files with 8 additions and 2 deletions
|
@ -41,6 +41,12 @@ corrosion_import_crate(
|
|||
FLAGS "${CARGO_FLAGS}"
|
||||
)
|
||||
|
||||
if (Rust_CARGO_TARGET)
|
||||
set(rust_target_dir "${CMAKE_BINARY_DIR}/cargo/build/${_CORROSION_RUST_CARGO_TARGET}")
|
||||
else()
|
||||
set(rust_target_dir "${CMAKE_BINARY_DIR}/cargo/build/${_CORROSION_RUST_CARGO_HOST_TARGET}")
|
||||
endif()
|
||||
|
||||
# Temporary hack to propogate CMake flags/options to build.rs. We need to get CMake to evaluate the
|
||||
# truthiness of the strings if they are set.
|
||||
set(CMAKE_WITH_GETTEXT "1")
|
||||
|
|
|
@ -163,7 +163,7 @@ endif()
|
|||
if(NOT DEFINED ASAN)
|
||||
add_test(
|
||||
NAME "cargo-test"
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test ${CARGO_FLAGS} --package fish-rust --target-dir target ${cargo_target_opt}
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test ${CARGO_FLAGS} --package fish-rust --target-dir ${rust_target_dir} ${cargo_target_opt}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
)
|
||||
set_tests_properties("cargo-test" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
|
@ -172,7 +172,7 @@ endif()
|
|||
|
||||
add_test(
|
||||
NAME "cargo-test-widestring"
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test ${CARGO_FLAGS} --package widestring-suffix --target-dir target ${cargo_target_opt}
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test ${CARGO_FLAGS} --package widestring-suffix --target-dir ${rust_target_dir} ${cargo_target_opt}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
)
|
||||
add_test_target("cargo-test-widestring")
|
||||
|
|
Loading…
Reference in a new issue