| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg')) | 81 var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg')) |
| 82 .listSync() | 82 .listSync() |
| 83 .map((e) => e.path) | 83 .map((e) => e.path) |
| 84 .where((p) => p.endsWith('.sum')) | 84 .where((p) => p.endsWith('.sum')) |
| 85 .toList(); | 85 .toList(); |
| 86 | 86 |
| 87 var sharedCompiler = new ModuleCompiler(new AnalyzerOptions.basic( | 87 var sharedCompiler = new ModuleCompiler(new AnalyzerOptions.basic( |
| 88 dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths)); | 88 dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths)); |
| 89 | 89 |
| 90 var testDirs = ['language', 'corelib', 'lib']; | 90 var testDirs = ['language', 'corelib_2', 'lib']; |
| 91 | 91 |
| 92 // Copy all of the test files and expanded multitest files to | 92 // Copy all of the test files and expanded multitest files to |
| 93 // gen/codegen_tests. We'll compile from there. | 93 // gen/codegen_tests. We'll compile from there. |
| 94 TestUtils.setDartDirUri(Platform.script.resolve('../../..')); | 94 TestUtils.setDartDirUri(Platform.script.resolve('../../..')); |
| 95 var testFiles = _setUpTests(testDirs); | 95 var testFiles = _setUpTests(testDirs); |
| 96 _writeRuntimeStatus(testFiles); | 96 _writeRuntimeStatus(testFiles); |
| 97 | 97 |
| 98 // Our default compiler options. Individual tests can override these. | 98 // Our default compiler options. Individual tests can override these. |
| 99 var defaultOptions = ['--no-source-map', '--no-summarize']; | 99 var defaultOptions = ['--no-source-map', '--no-summarize']; |
| 100 var compileArgParser = new ArgParser(); | 100 var compileArgParser = new ArgParser(); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 StringLiteral uriLiteral = directive.uri; | 453 StringLiteral uriLiteral = directive.uri; |
| 454 String uriContent = uriLiteral.stringValue; | 454 String uriContent = uriLiteral.stringValue; |
| 455 if (uriContent != null) { | 455 if (uriContent != null) { |
| 456 uriContent = uriContent.trim(); | 456 uriContent = uriContent.trim(); |
| 457 directive.uriContent = uriContent; | 457 directive.uriContent = uriContent; |
| 458 } | 458 } |
| 459 return (directive as UriBasedDirectiveImpl).validate() == null | 459 return (directive as UriBasedDirectiveImpl).validate() == null |
| 460 ? uriContent | 460 ? uriContent |
| 461 : null; | 461 : null; |
| 462 } | 462 } |
| OLD | NEW |