Skip to content

Commit 3a98ccf

Browse files
author
Dave Abrahams
authored
"Working" fix for previous commit
1 parent 26f0475 commit 3a98ccf

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

test/lit.cfg

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,26 @@ class SwiftTest(lit.formats.ShTest, object):
144144
self.skipped_tests = set()
145145

146146
def before_test(self, test, litConfig):
147+
_, tmp_base = lit.TestRunner.getTempPaths(test)
148+
149+
# Apparently despite the docs, tmpDir is not actually unique for each test, but
150+
# tmpBase is. Remove it here and add a tmpBase substitution in before_test.
151+
# Speculative fix for rdar://32928464.
152+
try:
153+
percentT_index = [x[0] for x in test.config.substitutions].index('%T')
154+
except ValueError: pass
155+
else:
156+
test.config.substitutions.pop(percentT_index)
157+
test.config.substitutions.append(('%T', tmp_base))
158+
147159
if self.coverage_mode:
148160
# FIXME: The compiler crashers run so fast they fill up the
149161
# merger's queue (and therefore the build bot's disk)
150162
if 'crasher' in test.getSourcePath():
151163
test.config.environment["LLVM_PROFILE_FILE"] = os.devnull
152164
self.skipped_tests.add(test.getSourcePath())
153165
return
154-
155-
_, tmp_base = lit.TestRunner.getTempPaths(test)
166+
156167
if self.coverage_mode == "NOT_MERGED":
157168
profdir = tmp_base + '.profdir'
158169
if not os.path.exists(profdir):
@@ -357,11 +368,6 @@ completion_cache_path = tempfile.mkdtemp(prefix="swift-testsuite-completion-cach
357368
ccp_opt = "-completion-cache-path %r" % completion_cache_path
358369
lit_config.note("Using code completion cache: " + completion_cache_path)
359370

360-
# Apparently despite the docs, tmpDir is not actually unique for each test, but
361-
# tmpBase is. Speculative fix for rdar://31520207.
362-
config.substitutions.remove( ('%T', tmpDir) )
363-
config.substitutions.append( ('%T', tmpBase) )
364-
365371
config.substitutions.append( ('%swift_obj_root', config.swift_obj_root) )
366372
config.substitutions.append( ('%swift_src_root', config.swift_src_root) )
367373
config.substitutions.append( ('%{python}', sys.executable) )

0 commit comments

Comments
 (0)