Skip to content

Commit

Permalink
tell CTest to print on failure for cmark tests (swiftlang#59978)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus authored and hborla committed Jul 13, 2022
1 parent e61da71 commit 2a2892f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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 -
# 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
# 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

0 comments on commit 2a2892f

Please sign in to comment.