Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: test/codegen_test.dart

Issue 1612083002: Initial --modules=es6 support (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: reformat Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/src/options.dart ('K') | « test/codegen/expect/es6_modules.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen_test.dart
diff --git a/test/codegen_test.dart b/test/codegen_test.dart
index 66e41c82ffaa2ef1f80afd2cb6a22e302e4c58fe..5f1599348d7ec8a4133dcf049fe7590254570d5a 100644
--- a/test/codegen_test.dart
+++ b/test/codegen_test.dart
@@ -65,7 +65,10 @@ main(arguments) {
var expectDir = path.join(inputDir, 'expect');
BatchCompiler createCompiler(AnalysisContext context,
- {bool checkSdk: false, bool sourceMaps: false, bool closure: false}) {
+ {bool checkSdk: false,
+ bool sourceMaps: false,
+ bool closure: false,
+ ModuleFormat moduleFormat: ModuleFormat.dart}) {
// TODO(jmesserly): add a way to specify flags in the test file, so
// they're more self-contained.
var runtimeDir = path.join(path.dirname(testDirectory), 'lib', 'runtime');
@@ -74,7 +77,8 @@ main(arguments) {
outputDir: expectDir,
emitSourceMaps: sourceMaps,
closure: closure,
- forceCompile: checkSdk),
+ forceCompile: checkSdk,
+ moduleFormat: moduleFormat),
useColors: false,
checkSdk: checkSdk,
runtimeDir: runtimeDir,
@@ -147,14 +151,19 @@ $compilerMessages''';
// We need a more comprehensive strategy to test them.
var sourceMaps = filename == 'map_keys';
var closure = filename == 'closure';
+ var moduleFormat =
+ filename == 'es6_modules' ? ModuleFormat.es6 : ModuleFormat.dart;
Jennifer Messerly 2016/01/22 18:29:01 nice! I'll see if I can help clean this up (my TOD
var success;
// TODO(vsm): Is it okay to reuse the same context here? If there is
// overlap between test files, we may need separate ones for each
// compiler.
- var compiler = (sourceMaps || closure)
- ? createCompiler(realSdkContext,
- sourceMaps: sourceMaps, closure: closure)
- : batchCompiler;
+ var compiler =
+ (sourceMaps || closure || moduleFormat != ModuleFormat.dart)
+ ? createCompiler(realSdkContext,
+ sourceMaps: sourceMaps,
+ closure: closure,
+ moduleFormat: moduleFormat)
+ : batchCompiler;
success = compile(compiler, filePath);
var outFile = new File(path.join(outDir.path, '$filename.js'));
« lib/src/options.dart ('K') | « test/codegen/expect/es6_modules.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698