Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ compiler crashes.

2. Specify the local toolchain for Xcode's use via `Xcode->Toolchains`.


### Build Failures

Try the suggestions in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from . import cmake_product
from . import earlyswiftdriver
from .. import shell


class CMark(cmake_product.CMakeProduct):
Expand Down Expand Up @@ -94,8 +95,13 @@ def test(self, host_target):
# Xcode generator uses "RUN_TESTS" instead of "test".
results_targets = ['RUN_TESTS']

self.test_with_cmake(executable_target, results_targets,
self.args.cmark_build_variant, [])
test_env = {
"CTEST_OUTPUT_ON_FAILURE": "ON"
}

with shell.pushenv(test_env):
self.test_with_cmake(executable_target, results_targets,
self.args.cmark_build_variant, [])

def should_install(self, host_target):
"""should_install() -> Bool
Expand Down
23 changes: 23 additions & 0 deletions utils/swift_build_support/swift_build_support/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,29 @@ def pushd(path, dry_run=None, echo=True):
if not dry_run:
os.chdir(old_dir)

@contextmanager
def pushenv(env, dry_run=None, echo=True):
saved_env = {}
for name in env.keys():
if dry_run or echo:
_echo_command(dry_run, ['export', name + '=' + env[name]])
if not dry_run:
if name in os.environ:
saved_env[name] = os.environ[name]
os.environ[name] = env[name]
yield
for name in env.keys():
if name in saved_env:
if dry_run or echo:
_echo_command(dry_run, ['export', name + '=' + saved_env[name]])
if not dry_run:
os.environ[name] = saved_env[name]
else:
if dry_run or echo:
_echo_command(dry_run, ['unset', name])
if not dry_run:
del os.environ[name]


def makedirs(path, dry_run=None, echo=True):
dry_run = _coerce_dry_run(dry_run)
Expand Down