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 /// Tests code generation. | 5 /// Tests code generation. |
6 /// | 6 /// |
7 /// Runs Dart Dev Compiler on all input in the `codegen` directory and checks | 7 /// Runs Dart Dev Compiler on all input in the `codegen` directory and checks |
8 /// that the output is what we expected. | 8 /// that the output is what we expected. |
9 library dev_compiler.test.codegen_test; | 9 library dev_compiler.test.codegen_test; |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 var sdkDir = path.join(repoDirectory, 'gen', 'patched_sdk'); | 72 var sdkDir = path.join(repoDirectory, 'gen', 'patched_sdk'); |
73 var sdkSummaryFile = | 73 var sdkSummaryFile = |
74 path.join(testDirectory, '..', 'lib', 'sdk', 'ddc_sdk.sum'); | 74 path.join(testDirectory, '..', 'lib', 'sdk', 'ddc_sdk.sum'); |
75 | 75 |
76 var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg')) | 76 var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg')) |
77 .listSync() | 77 .listSync() |
78 .map((e) => e.path) | 78 .map((e) => e.path) |
79 .where((p) => p.endsWith('.sum')) | 79 .where((p) => p.endsWith('.sum')) |
80 .toList(); | 80 .toList(); |
81 | 81 |
82 var sharedCompiler = new ModuleCompiler(new AnalyzerOptions.basic( | 82 var sharedCompiler = new ModuleCompiler( |
83 dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths)); | 83 new AnalyzerOptions.basic( |
| 84 dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths)); |
84 | 85 |
85 var testDirs = [ | 86 var testDirs = [ |
86 'language', | 87 'language', |
87 'corelib', | 88 'corelib', |
88 path.join('corelib', 'regexp'), | 89 path.join('corelib', 'regexp'), |
89 path.join('lib', 'collection'), | 90 path.join('lib', 'collection'), |
90 path.join('lib', 'convert'), | 91 path.join('lib', 'convert'), |
91 path.join('lib', 'html'), | 92 path.join('lib', 'html'), |
92 // TODO(vsm): Fix these - they import files from a different directory | 93 // TODO(vsm): Fix these - they import files from a different directory |
93 // - this triggers an invalid library root build error. | 94 // - this triggers an invalid library root build error. |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 StringLiteral uriLiteral = directive.uri; | 359 StringLiteral uriLiteral = directive.uri; |
359 String uriContent = uriLiteral.stringValue; | 360 String uriContent = uriLiteral.stringValue; |
360 if (uriContent != null) { | 361 if (uriContent != null) { |
361 uriContent = uriContent.trim(); | 362 uriContent = uriContent.trim(); |
362 directive.uriContent = uriContent; | 363 directive.uriContent = uriContent; |
363 } | 364 } |
364 return (directive as UriBasedDirectiveImpl).validate() == null | 365 return (directive as UriBasedDirectiveImpl).validate() == null |
365 ? uriContent | 366 ? uriContent |
366 : null; | 367 : null; |
367 } | 368 } |
OLD | NEW |