| 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 |
| 11 // TODO(rnystrom): This doesn't actually run any tests any more. It just | 11 // TODO(rnystrom): This doesn't actually run any tests any more. It just |
| 12 // compiles stuff. This should be changed to not use unittest and just be a | 12 // compiles stuff. This should be changed to not use unittest and just be a |
| 13 // regular program that outputs files. | 13 // regular program that outputs files. |
| 14 | 14 |
| 15 import 'dart:io' show Directory, File, Platform; | 15 import 'dart:io' show Directory, File, Platform; |
| 16 import 'package:analyzer/analyzer.dart' | 16 import 'package:analyzer/analyzer.dart' |
| 17 show | 17 show |
| 18 ExportDirective, | 18 ExportDirective, |
| 19 ImportDirective, | 19 ImportDirective, |
| 20 StringLiteral, | 20 StringLiteral, |
| 21 UriBasedDirective, | 21 UriBasedDirective, |
| 22 parseDirectives; | 22 parseDirectives; |
| 23 import 'package:analyzer/src/generated/source.dart' show Source; | 23 import 'package:analyzer/src/generated/source.dart' show Source; |
| 24 import 'package:args/args.dart' show ArgParser, ArgResults; | 24 import 'package:args/args.dart' show ArgParser, ArgResults; |
| 25 import 'package:dev_compiler/src/analyzer/context.dart' show AnalyzerOptions; | 25 import 'package:dev_compiler/src/analyzer/context.dart' show AnalyzerOptions; |
| 26 import 'package:dev_compiler/src/compiler/compiler.dart' | 26 import 'package:dev_compiler/src/compiler/compiler.dart' |
| 27 show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler; | 27 show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler; |
| 28 import 'package:dev_compiler/src/compiler/module_builder.dart' | 28 import 'package:dev_compiler/src/compiler/module_builder.dart' |
| 29 show | 29 show ModuleFormat, addModuleFormatOptions, parseModuleFormatOption; |
| 30 ModuleFormat, | |
| 31 addModuleFormatOptions, | |
| 32 parseModuleFormatOption, | |
| 33 pathToJSIdentifier; | |
| 34 import 'package:path/path.dart' as path; | 30 import 'package:path/path.dart' as path; |
| 35 import 'package:test/test.dart' show expect, isFalse, isTrue, test; | 31 import 'package:test/test.dart' show expect, isFalse, isTrue, test; |
| 36 | 32 |
| 37 import '../tool/build_sdk.dart' as build_sdk; | 33 import '../tool/build_sdk.dart' as build_sdk; |
| 38 import 'testing.dart' show repoDirectory, testDirectory; | 34 import 'testing.dart' show repoDirectory, testDirectory; |
| 39 import 'multitest.dart' show extractTestsFromMultitest, isMultiTest; | 35 import 'multitest.dart' show extractTestsFromMultitest, isMultiTest; |
| 40 import 'not_yet_strong_tests.dart'; | 36 import 'not_yet_strong_tests.dart'; |
| 41 | 37 |
| 42 final ArgParser argParser = new ArgParser() | 38 final ArgParser argParser = new ArgParser() |
| 43 ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null); | 39 ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 /// Simplified from ParseDartTask.resolveDirective. | 321 /// Simplified from ParseDartTask.resolveDirective. |
| 326 String _resolveDirective(UriBasedDirective directive) { | 322 String _resolveDirective(UriBasedDirective directive) { |
| 327 StringLiteral uriLiteral = directive.uri; | 323 StringLiteral uriLiteral = directive.uri; |
| 328 String uriContent = uriLiteral.stringValue; | 324 String uriContent = uriLiteral.stringValue; |
| 329 if (uriContent != null) { | 325 if (uriContent != null) { |
| 330 uriContent = uriContent.trim(); | 326 uriContent = uriContent.trim(); |
| 331 directive.uriContent = uriContent; | 327 directive.uriContent = uriContent; |
| 332 } | 328 } |
| 333 return directive.validate() == null ? uriContent : null; | 329 return directive.validate() == null ? uriContent : null; |
| 334 } | 330 } |
| OLD | NEW |