Skip to content

Commit f1a7160

Browse files
committed
Modernize testcase (NFC)
1 parent 8d7bd10 commit f1a7160

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,6 @@ TypeSystemSwiftTypeRef::GetSwiftASTContext(const SymbolContext *sc) const {
15091509
std::lock_guard<std::mutex> guard(m_swift_ast_context_lock);
15101510
// There is only one per-module context.
15111511
const char *key = nullptr;
1512-
15131512
// Look up the SwiftASTContext in the cache.
15141513
auto it = m_swift_ast_context_map.find(key);
15151514
if (it != m_swift_ast_context_map.end()) {

lldb/test/API/lang/swift/playgrounds/TestSwiftPlaygrounds.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,20 @@ def launch(self, force_target):
137137
self.expect('settings set target.swift-framework-search-paths "%s"' %
138138
self.getBuildDir())
139139

140-
self.options = lldb.SBExpressionOptions()
141-
self.options.SetLanguage(lldb.eLanguageTypeSwift)
142-
self.options.SetPlaygroundTransformEnabled()
143-
# The concurrency expressions will spawn multiple threads.
144-
self.options.SetOneThreadTimeoutInMicroSeconds(1)
145-
self.options.SetTryAllThreads(True)
146-
147-
148140
def execute_code(self, input_file, expect_error=False):
149141
contents = "syntax error"
150142
with open(input_file, 'r') as contents_file:
151143
contents = contents_file.read()
152-
res = self.frame().EvaluateExpression(contents, self.options)
144+
145+
options = lldb.SBExpressionOptions()
146+
options.SetLanguage(lldb.eLanguageTypeSwift)
147+
options.SetPlaygroundTransformEnabled()
148+
# The concurrency expressions will spawn multiple threads.
149+
options.SetOneThreadTimeoutInMicroSeconds(1)
150+
options.SetTryAllThreads(True)
151+
options.SetAutoApplyFixIts(False)
152+
153+
res = self.frame().EvaluateExpression(contents, options)
153154
ret = self.frame().EvaluateExpression("get_output()")
154155
is_error = res.GetError().Fail() and not (
155156
res.GetError().GetType() == 1 and
@@ -198,12 +199,5 @@ def do_import_test(self):
198199
self.assertIn("Hello from the Dylib", playground_output)
199200

200201
# Scan through the types log to make sure the SwiftASTContext was poisoned.
201-
import io
202-
logfile = io.open(log, "r", encoding='utf-8')
203-
found = 0
204-
for line in logfile:
205-
if 'New Swift image added' in line \
206-
and 'Versions/A/Dylib' in line \
207-
and 'ClangImporter needs to be reinitialized' in line:
208-
found += 1
209-
self.assertGreater(found, 1)
202+
self.filecheck('platform shell cat ""%s"' % log, __file__)
203+
# CHECK: New Swift image added{{.*}}Versions/A/Dylib{{.*}}ClangImporter needs to be reinitialized

0 commit comments

Comments
 (0)