Index: test/codegen_test.dart |
diff --git a/test/codegen_test.dart b/test/codegen_test.dart |
index 66e41c82ffaa2ef1f80afd2cb6a22e302e4c58fe..4c791d6b18210508faa7aea57b3989850759f188 100644 |
--- a/test/codegen_test.dart |
+++ b/test/codegen_test.dart |
@@ -65,7 +65,8 @@ 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 +75,8 @@ main(arguments) { |
outputDir: expectDir, |
emitSourceMaps: sourceMaps, |
closure: closure, |
- forceCompile: checkSdk), |
+ forceCompile: checkSdk, |
+ moduleFormat: moduleFormat), |
useColors: false, |
checkSdk: checkSdk, |
runtimeDir: runtimeDir, |
@@ -147,13 +149,16 @@ $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; |
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) |
+ var compiler = (sourceMaps || closure || moduleFormat != ModuleFormat.dart) |
? createCompiler(realSdkContext, |
- sourceMaps: sourceMaps, closure: closure) |
+ sourceMaps: sourceMaps, closure: closure, |
+ moduleFormat: moduleFormat) |
: batchCompiler; |
success = compile(compiler, filePath); |