Files
swift-mirror/test/PlaygroundTransform/lit.local.cfg
Alastair Houghton 0bc76dae80 [Backtracing] Add warning suppression option, enable it for tests.
The backtracing code will warn you if you attempt to forcibly enable
backtracing for a privileged executable.  This is apparently upsetting
the Driver/filelists.swift test.

Since we want to force it on for tests, so that we will definitely get
backtraces, add an option to suppress warning messages, and turn that
on for tests as well.

rdar://144497613
2025-02-24 12:55:16 +00:00

29 lines
1.3 KiB
INI

# Local lit cfg for PlaygroundTransform
# Copied from lit.cfg
def escape_for_substitute_captures(s):
return s.replace("\\", "\\\\")
# Macro to simplify most PlaygroundTransform tests
config.target_playground_build_run_swift_parameterized = SubstituteCaptures(
# Clear temp directory
r'rm -rf "%%t" && mkdir -p "%%t" && '
# Build PlaygroundSupport module
r'%s -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %%t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %%t/PlaygroundSupport.o %%S/Inputs/SilentPCMacroRuntime.swift %%S/Inputs/PlaygroundsRuntime.swift && '
# Create main.swift
r'cp %%s %%t/main.swift && '
# Build test source
r'%s \1 -o %%t/a.out -module-name main -I=%%t %%t/PlaygroundSupport.o %%t/main.swift && '
# Codesign executable
r'%s %%t/a.out && '
# Run executable
r'%s %%t/a.out'
% (escape_for_substitute_captures(config.target_build_swift),
escape_for_substitute_captures(config.target_build_swift),
escape_for_substitute_captures(config.target_codesign),
escape_for_substitute_captures(config.target_run))
)
config.substitutions.append((r'%target-playground-build-run-swift\(([^)]+)\)',
config.target_playground_build_run_swift_parameterized))