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

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: addressed comments (legacy, doc) + test enum utils 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
« no previous file with comments | « test/codegen/expect/es6_modules.txt ('k') | test/utils_test.dart » ('j') | 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..fbda6fb704217f7ebea71601ae4f519bef4b8099 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.legacy}) {
// 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.legacy;
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.legacy)
+ ? createCompiler(realSdkContext,
+ sourceMaps: sourceMaps,
+ closure: closure,
+ moduleFormat: moduleFormat)
+ : batchCompiler;
success = compile(compiler, filePath);
var outFile = new File(path.join(outDir.path, '$filename.js'));
« no previous file with comments | « test/codegen/expect/es6_modules.txt ('k') | test/utils_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698