OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.test.src.summary.summarize_ast_test; | 5 library analyzer.test.src.summary.summarize_ast_test; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
11 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 11 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
12 import 'package:analyzer/src/generated/error.dart'; | 12 import 'package:analyzer/src/generated/error.dart'; |
13 import 'package:analyzer/src/generated/parser.dart'; | 13 import 'package:analyzer/src/generated/parser.dart'; |
14 import 'package:analyzer/src/generated/source.dart'; | 14 import 'package:analyzer/src/generated/source.dart'; |
15 import 'package:analyzer/src/summary/format.dart'; | 15 import 'package:analyzer/src/summary/format.dart'; |
16 import 'package:analyzer/src/summary/idl.dart'; | 16 import 'package:analyzer/src/summary/idl.dart'; |
17 import 'package:analyzer/src/summary/link.dart'; | 17 import 'package:analyzer/src/summary/link.dart'; |
18 import 'package:analyzer/src/summary/package_bundle_reader.dart'; | 18 import 'package:analyzer/src/summary/package_bundle_reader.dart'; |
19 import 'package:analyzer/src/summary/summarize_ast.dart'; | 19 import 'package:analyzer/src/summary/summarize_ast.dart'; |
20 import 'package:analyzer/src/summary/summarize_elements.dart'; | 20 import 'package:analyzer/src/summary/summarize_elements.dart'; |
| 21 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
21 import 'package:unittest/unittest.dart'; | 22 import 'package:unittest/unittest.dart'; |
22 | 23 |
23 import '../../reflective_tests.dart'; | |
24 import 'summary_common.dart'; | 24 import 'summary_common.dart'; |
25 | 25 |
26 main() { | 26 main() { |
27 groupSep = ' | '; | 27 groupSep = ' | '; |
28 runReflectiveTests(LinkedSummarizeAstSpecTest); | 28 defineReflectiveTests(LinkedSummarizeAstSpecTest); |
29 } | 29 } |
30 | 30 |
31 @reflectiveTest | 31 @reflectiveTest |
32 class LinkedSummarizeAstSpecTest extends LinkedSummarizeAstTest { | 32 class LinkedSummarizeAstSpecTest extends LinkedSummarizeAstTest { |
33 @override | 33 @override |
34 bool get strongMode => false; | 34 bool get strongMode => false; |
35 | 35 |
36 @override | 36 @override |
37 @failingTest | 37 @failingTest |
38 test_bottom_reference_shared() { | 38 test_bottom_reference_shared() { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 */ | 258 */ |
259 Source addNamedSource(String filePath, String contents) { | 259 Source addNamedSource(String filePath, String contents) { |
260 CompilationUnit unit = _parseText(contents); | 260 CompilationUnit unit = _parseText(contents); |
261 UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit); | 261 UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit); |
262 _filesToLink.uriToUnit[absUri(filePath)] = unlinkedUnit; | 262 _filesToLink.uriToUnit[absUri(filePath)] = unlinkedUnit; |
263 // Tests using SummaryLinkerTest don't actually need the returned | 263 // Tests using SummaryLinkerTest don't actually need the returned |
264 // Source, so we can safely return `null`. | 264 // Source, so we can safely return `null`. |
265 return null; | 265 return null; |
266 } | 266 } |
267 | 267 |
268 LinkerInputs createLinkerInputs(String text, {String path: '/test.dart', Strin
g uri}) { | 268 LinkerInputs createLinkerInputs(String text, |
| 269 {String path: '/test.dart', String uri}) { |
269 uri ??= absUri(path); | 270 uri ??= absUri(path); |
270 Uri testDartUri = Uri.parse(uri); | 271 Uri testDartUri = Uri.parse(uri); |
271 CompilationUnit unit = _parseText(text); | 272 CompilationUnit unit = _parseText(text); |
272 UnlinkedUnitBuilder unlinkedDefiningUnit = serializeAstUnlinked(unit); | 273 UnlinkedUnitBuilder unlinkedDefiningUnit = serializeAstUnlinked(unit); |
273 _filesToLink.uriToUnit[testDartUri.toString()] = unlinkedDefiningUnit; | 274 _filesToLink.uriToUnit[testDartUri.toString()] = unlinkedDefiningUnit; |
274 LinkerInputs linkerInputs = new LinkerInputs( | 275 LinkerInputs linkerInputs = new LinkerInputs( |
275 allowMissingFiles, | 276 allowMissingFiles, |
276 _filesToLink.uriToUnit, | 277 _filesToLink.uriToUnit, |
277 testDartUri, | 278 testDartUri, |
278 unlinkedDefiningUnit, | 279 unlinkedDefiningUnit, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 * passed to [addNamedSource]. | 333 * passed to [addNamedSource]. |
333 */ | 334 */ |
334 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; | 335 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; |
335 | 336 |
336 /** | 337 /** |
337 * Information about summaries to be included in the link process. | 338 * Information about summaries to be included in the link process. |
338 */ | 339 */ |
339 SummaryDataStore summaryDataStore = | 340 SummaryDataStore summaryDataStore = |
340 new SummaryDataStore([], recordDependencyInfo: true); | 341 new SummaryDataStore([], recordDependencyInfo: true); |
341 } | 342 } |
OLD | NEW |