Skip to content

Commit

Permalink
Merge pull request swiftlang#24100 from shajrawi/support_simple_run
Browse files Browse the repository at this point in the history
lit.cfg: Respect the DYLD_LIBRARY_PATH restrictions when not using %target-run
  • Loading branch information
Rostepher authored Apr 19, 2019
2 parents 802d516 + 404b34c commit ea0e7f1
Showing 1 changed file with 41 additions and 42 deletions.
83 changes: 41 additions & 42 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1242,48 +1242,6 @@ if sftp_server_path:
config.substitutions.append(('%sftp-server',
sftp_server_path or 'no-sftp-server'))


if not getattr(config, 'target_run_simple_swift', None):
config.target_run_simple_swift_parameterized = \
(SubstituteCaptures('%%empty-directory(%%t) && '
'%s %s %%s \\1 -o %%t/a.out -module-name main && '
'%s %%t/a.out &&'
'%s %%t/a.out' % (config.target_build_swift,
mcp_opt, config.target_codesign,
config.target_run)))
config.target_run_simple_swift = (
'%%empty-directory(%%t) && '
'%s %s %%s -o %%t/a.out -module-name main && '
'%s %%t/a.out &&'
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))
config.target_run_stdlib_swift = (
'%%empty-directory(%%t) && '
'%s %s %%s -o %%t/a.out -module-name main '
'-Xfrontend -disable-access-control && '
'%s %%t/a.out &&'
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))
config.target_run_simple_swiftgyb = (
'%%empty-directory(%%t) && '
'%%gyb %%s -o %%t/main.swift && '
'%%line-directive %%t/main.swift -- '
'%s %s %%t/main.swift -o %%t/a.out -module-name main && '
'%s %%t/a.out &&'
'%%line-directive %%t/main.swift -- '
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))
config.target_run_stdlib_swiftgyb = (
'%%empty-directory(%%t) && '
'%%gyb %%s -o %%t/main.swift && '
'%%line-directive %%t/main.swift -- '
'%s %s %%t/main.swift -o %%t/a.out -module-name main '
'-Xfrontend -disable-access-control && '
'%s %%t/a.out &&'
'%%line-directive %%t/main.swift -- '
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))

subst_target_jit_run = ""
if 'swift_interpreter' in config.available_features:
subst_target_jit_run = (
Expand Down Expand Up @@ -1373,6 +1331,47 @@ if not kIsWindows:
"LD_LIBRARY_PATH='{0}' " # Linux option
"SIMCTL_CHILD_DYLD_LIBRARY_PATH='{0}' " # Simulator option
.format(all_stdlib_path)) + config.target_run

if not getattr(config, 'target_run_simple_swift', None):
config.target_run_simple_swift_parameterized = \
(SubstituteCaptures('%%empty-directory(%%t) && '
'%s %s %%s \\1 -o %%t/a.out -module-name main && '
'%s %%t/a.out &&'
'%s %%t/a.out' % (config.target_build_swift,
mcp_opt, config.target_codesign,
config.target_run)))
config.target_run_simple_swift = (
'%%empty-directory(%%t) && '
'%s %s %%s -o %%t/a.out -module-name main && '
'%s %%t/a.out &&'
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))
config.target_run_stdlib_swift = (
'%%empty-directory(%%t) && '
'%s %s %%s -o %%t/a.out -module-name main '
'-Xfrontend -disable-access-control && '
'%s %%t/a.out &&'
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))
config.target_run_simple_swiftgyb = (
'%%empty-directory(%%t) && '
'%%gyb %%s -o %%t/main.swift && '
'%%line-directive %%t/main.swift -- '
'%s %s %%t/main.swift -o %%t/a.out -module-name main && '
'%s %%t/a.out &&'
'%%line-directive %%t/main.swift -- '
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))
config.target_run_stdlib_swiftgyb = (
'%%empty-directory(%%t) && '
'%%gyb %%s -o %%t/main.swift && '
'%%line-directive %%t/main.swift -- '
'%s %s %%t/main.swift -o %%t/a.out -module-name main '
'-Xfrontend -disable-access-control && '
'%s %%t/a.out &&'
'%%line-directive %%t/main.swift -- '
'%s %%t/a.out'
% (config.target_build_swift, mcp_opt, config.target_codesign, config.target_run))

#
# When changing substitutions, update docs/Testing.rst.
Expand Down

0 comments on commit ea0e7f1

Please sign in to comment.