Skip to content

[test] Allow setting extra environment for running tests. #35619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2021
Merged
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
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ set(LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
# consecutive execution, which makes local builds fail faster.
set(SWIFT_LIT_ARGS "--incremental" CACHE STRING "Arguments to pass to lit")

set(SWIFT_LIT_ENVIRONMENT "" CACHE STRING "Environment to use for lit invocations")

if(NOT SWIFT_INCLUDE_TOOLS)
list(APPEND SWIFT_LIT_ARGS
"--path=${SWIFT_NATIVE_LLVM_TOOLS_PATH}"
Expand Down Expand Up @@ -390,6 +392,7 @@ foreach(SDK ${SWIFT_SDKS})
${command_upload_swift_reflection_test}
${command_clean_test_results_dir}
COMMAND
${CMAKE_COMMAND} -E env ${SWIFT_LIT_ENVIRONMENT}
$<TARGET_FILE:Python3::Interpreter> "${LIT}"
${LIT_ARGS}
"--param" "swift_test_subset=${test_subset}"
Expand All @@ -409,6 +412,7 @@ foreach(SDK ${SWIFT_SDKS})
${command_upload_swift_reflection_test}
${command_clean_test_results_dir}
COMMAND
${CMAKE_COMMAND} -E env ${SWIFT_LIT_ENVIRONMENT}
$<TARGET_FILE:Python3::Interpreter> "${LIT}"
${LIT_ARGS}
"--param" "swift_test_subset=${test_subset}"
Expand Down