@@ -10,16 +10,26 @@ class TestSwiftXcodeSDK(lldbtest.TestBase):
1010 mydir = lldbtest .TestBase .compute_mydir (__file__ )
1111 NO_DEBUG_INFO_TESTCASE = True
1212
13- def check_log (self , log , expected_path ):
13+ def check_log (self , log , expected_path , expect_precise ):
1414 import io
1515 logfile = io .open (log , "r" , encoding = 'utf-8' )
16- in_expr_log = 0
1716 found = 0
17+ precise = False
1818 for line in logfile :
19- if (line .startswith (' SwiftASTContextForExpressions(module: "a", cu: "main.swift")::LogConfiguration()' ) and
20- "SDK path" in line and expected_path in line ):
19+ if not line .startswith (' SwiftASTContextForExpressions(module: "a", cu: "main.swift")' ):
20+ continue
21+ if "Using precise SDK" in line :
22+ precise = True
23+ continue
24+ if "Override target.sdk-path" in line :
25+ precise = False
26+ continue
27+ if not '::LogConfiguration()' in line :
28+ continue
29+ if "SDK path" in line and expected_path in line :
2130 found += 1
2231 self .assertEqual (found , 1 )
32+ self .assertEqual (precise , expect_precise )
2333
2434 @swiftTest
2535 @skipUnlessDarwin
@@ -33,7 +43,7 @@ def test_decode(self):
3343 lldbutil .run_to_name_breakpoint (self , 'main' )
3444
3545 self .expect ("expression 1" )
36- self .check_log (log , "MacOSX" )
46+ self .check_log (log , "MacOSX" , True )
3747
3848 @swiftTest
3949 @skipUnlessDarwin
@@ -52,7 +62,7 @@ def test_decode_sim(self):
5262 lldbutil .run_to_name_breakpoint (self , 'main' )
5363
5464 self .expect ("expression 1" )
55- self .check_log (log , "iPhoneSimulator" )
65+ self .check_log (log , "iPhoneSimulator" , True )
5666
5767 @swiftTest
5868 @skipUnlessDarwin
@@ -72,4 +82,4 @@ def test_override(self):
7282 lldbutil .run_to_name_breakpoint (self , 'main' )
7383
7484 self .expect ("expression 1" )
75- self .check_log (log , ios_sdk )
85+ self .check_log (log , ios_sdk , False )
0 commit comments