mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
test_cargo-test: inherit same variables as Corrosion build targets
In particular, pass the build directory, which is required in some test scenarios (see next commit).
This commit is contained in:
parent
a20525c44f
commit
7686c39d76
2 changed files with 5 additions and 3 deletions
|
@ -54,7 +54,7 @@ file(REAL_PATH "${CMAKE_BINARY_DIR}" fish_binary_dir)
|
|||
string(JOIN "," CURSES_LIBRARY_LIST ${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY})
|
||||
|
||||
# Tell Cargo where our build directory is so it can find config.h.
|
||||
corrosion_set_env_vars(${fish_rust_target}
|
||||
set(VARS_FOR_CARGO
|
||||
"FISH_BUILD_DIR=${fish_binary_dir}"
|
||||
"PREFIX=${CMAKE_INSTALL_PREFIX}"
|
||||
# Temporary hack to propogate CMake flags/options to build.rs.
|
||||
|
@ -66,3 +66,5 @@ corrosion_set_env_vars(${fish_rust_target}
|
|||
"LOCALEDIR=${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
"CURSES_LIBRARY_LIST=${CURSES_LIBRARY_LIST}"
|
||||
)
|
||||
|
||||
corrosion_set_env_vars(${fish_rust_target} ${VARS_FOR_CARGO})
|
||||
|
|
|
@ -163,7 +163,7 @@ endif()
|
|||
if(NOT DEFINED ASAN)
|
||||
add_test(
|
||||
NAME "cargo-test"
|
||||
COMMAND 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 target ${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 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 target ${cargo_target_opt}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
)
|
||||
add_test_target("cargo-test-widestring")
|
||||
|
|
Loading…
Reference in a new issue