|
21 | 21 | class TestSwiftRewriteClangPaths(TestBase):
|
22 | 22 | # Don't run ClangImporter tests if Clangimporter is disabled.
|
23 | 23 | @skipIf(setting=('symbols.use-swift-clangimporter', 'false'))
|
24 |
| - @skipIf(setting=('symbols.swift-precise-compiler-invocation', 'true')) |
| 24 | + @skipIf(setting=('symbols.swift-precise-compiler-invocation', 'false')) |
25 | 25 | @skipUnlessDarwin
|
26 | 26 | @swiftTest
|
27 | 27 | @skipIf(debug_info=no_match(["dsym"]))
|
28 |
| - @expectedFailureAll(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true')) |
29 | 28 | def testWithRemap(self):
|
30 | 29 | self.dotest(True)
|
31 | 30 |
|
32 | 31 | # Don't run ClangImporter tests if Clangimporter is disabled.
|
33 | 32 | @skipIf(setting=('symbols.use-swift-clangimporter', 'false'))
|
34 |
| - @skipIf(setting=('symbols.swift-precise-compiler-invocation', 'true')) |
| 33 | + @skipIf(setting=('symbols.swift-precise-compiler-invocation', 'false')) |
35 | 34 | @skipUnlessDarwin
|
36 | 35 | @swiftTest
|
37 | 36 | @skipIf(debug_info=no_match(["dsym"]))
|
@@ -88,47 +87,16 @@ def dotest(self, remap):
|
88 | 87 | self.expect("expression foo", error=True)
|
89 | 88 |
|
90 | 89 | # Scan through the types log.
|
91 |
| - errs = 0 |
92 |
| - found_iquote = 0 |
93 |
| - found_f = 0 |
94 |
| - found_i1 = 0 |
95 |
| - found_i2 = 0 |
96 |
| - found_rel = 0 |
97 |
| - found_abs = 0 |
98 |
| - found_ovl = 0 |
99 |
| - in_scratch_context = False |
100 |
| - import io |
101 |
| - logfile = io.open(log, "r", encoding='utf-8') |
102 |
| - for line in logfile: |
103 |
| - self.assertFalse("remapped -iquote" in line) |
104 |
| - if "error: " in line and "Foo" in line: |
105 |
| - errs += 1 |
106 |
| - continue |
107 |
| - if line.startswith(" SwiftASTContextForExpressions"): |
108 |
| - in_scratch_context = True |
109 |
| - if " remapped " in line: |
110 |
| - if line[:-1].endswith('/user'): |
111 |
| - found_abs += 1; |
112 |
| - continue |
113 |
| - if not in_scratch_context: |
114 |
| - continue |
115 |
| - if 'user/iquote-path' in line: found_iquote += 1; continue |
116 |
| - if 'user/I-single' in line: found_i1 += 1; continue |
117 |
| - if 'user/I-double' in line: found_i2 += 1; continue |
118 |
| - if './iquote-path' in line: found_rel += 1; continue |
119 |
| - if './I-' in line: found_rel += 1; continue |
120 |
| - if '/user/Frameworks' in line: found_f += 1; continue |
121 |
| - if 'user/Foo/overlay.yaml' in line: found_ovl += 1; continue |
122 |
| - |
123 |
| - if remap: |
124 |
| - self.assertEqual(errs, 0, "expected no module import error") |
125 |
| - # Counting occurences in the scratch context. |
126 |
| - self.assertEqual(found_iquote, 3) |
127 |
| - self.assertEqual(found_i1, 3) |
128 |
| - self.assertEqual(found_i2, 3) |
129 |
| - self.assertEqual(found_f, 3) |
130 |
| - self.assertEqual(found_rel, 0) |
131 |
| - self.assertEqual(found_abs, 1) |
132 |
| - self.assertEqual(found_ovl, 3) |
133 |
| - else: |
134 |
| - self.assertGreater(errs, 0, "expected module import error") |
| 90 | + suffix = "REMAP" if remap else "NORMAL" |
| 91 | + self.filecheck('platform shell cat "%s"' % log, __file__, |
| 92 | + '--check-prefix=CHECK_' + suffix) |
| 93 | +# CHECK_REMAP-NOT: remapped -iquote |
| 94 | +# CHECK_REMAP-NOT: error:{{.*}}Foo |
| 95 | +# CHECK_NORMAL: error:{{.*}}Foo |
| 96 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/buildbot/Foo{{.*}} -> {{.*}}/user/Foo |
| 97 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/buildbot/iquote-path{{.*}} -> {{.*}}/user/iquote-path |
| 98 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/buildbot/I-double{{.*}} -> {{.*}}/user/I-double |
| 99 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/buildbot/I-single{{.*}} -> {{.*}}/user/I-single |
| 100 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/buildbot/Frameworks{{.*}} -> {{.*}}/user/Frameworks |
| 101 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/nonexisting-rootdir{{.*}} -> {{.*}}/user |
| 102 | +# CHECK_REMAP-DAG: SwiftASTContextForExpressions(module: "Foo"{{.*}}/buildbot/Foo/overlay.yaml{{.*}} -> {{.*}}/user/Foo/overlay.yaml |
0 commit comments