Skip to content

Commit 56e3875

Browse files
committed
Merge pull request #1806 from drewcrawford/test-infrastructure-squashed
2 parents bd8459c + a315461 commit 56e3875

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/Testing.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ code for the target that is not the build machine:
267267
* ``%target-sdk-name``: only for Apple platforms: ``xcrun``-style SDK name
268268
(``macosx``, ``iphoneos``, ``iphonesimulator``).
269269

270+
* ``%target-static-stdlib-path``: the path to the static standard library.
271+
272+
Add ``REQUIRES: static_stdlib`` to the test.
273+
270274
Always use ``%target-*`` substitutions unless you have a good reason. For
271275
example, an exception would be a test that checks how the compiler handles
272276
mixing module files for incompatible platforms (that test would need to compile

test/lit.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,3 +873,11 @@ config.substitutions.append(('%target-resilience-test', config.target_resilience
873873

874874
config.substitutions.append(('%llvm-profdata', config.llvm_profdata))
875875
config.substitutions.append(('%llvm-cov', config.llvm_cov))
876+
877+
# If static stdlib is present, enable static stdlib tests
878+
static_stdlib_path = os.path.join(os.path.join(config.swift_lib_dir,"swift_static"), config.target_sdk_name)
879+
libswiftCore_path = os.path.join(static_stdlib_path,"libswiftCore.a")
880+
if os.path.exists(libswiftCore_path):
881+
config.available_features.add("static_stdlib")
882+
config.substitutions.append(('%target-static-stdlib-path', static_stdlib_path))
883+
lit_config.note('using static stdlib path: %s' % static_stdlib_path)

0 commit comments

Comments
 (0)