Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def build_with_cmake(self, build_targets, build_type, build_args,
+ build_args + build_targets)

def test_with_cmake(self, executable_target, results_targets,
build_type, build_args):
build_type, build_args, test_env=None):
assert self.toolchain.cmake is not None
cmake_build = []

Expand Down Expand Up @@ -117,7 +117,9 @@ def target_flag(target):
if test_target.startswith("check-swift") and self.args.test_paths:
test_target = test_target + "-custom"

shell.call(cmake_build + target_flag(test_target))
# note that passing variables via test_env won't affect lit tests -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how readable this comment is.

# lit.cfg will filter environment variables out!
shell.call(cmake_build + target_flag(test_target), env=test_env)

print("--- %s finished ---" % target)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ def test(self, host_target):
# Xcode generator uses "RUN_TESTS" instead of "test".
results_targets = ['RUN_TESTS']

test_env = {
"CTEST_OUTPUT_ON_FAILURE": "ON"
}

# see the comment in cmake_product.py if you want to copy this code to pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to add a breadcrumb here while keeping the main message in a single place.

# environment variables to tests
self.test_with_cmake(executable_target, results_targets,
self.args.cmark_build_variant, [])
self.args.cmark_build_variant, [], test_env)

def should_install(self, host_target):
"""should_install() -> Bool
Expand Down