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

Unified Diff: pkg/dev_compiler/test/codegen_test.dart

Issue 2757753002: Migrate DDC to the new analysis driver.
Patch Set: Rebase Created 3 years, 6 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
Index: pkg/dev_compiler/test/codegen_test.dart
diff --git a/pkg/dev_compiler/test/codegen_test.dart b/pkg/dev_compiler/test/codegen_test.dart
index 333b8187ecc97b4f3d0651e96940ac87f2357811..22b62b710602783ff7cc7216346a6c296fd4715d 100644
--- a/pkg/dev_compiler/test/codegen_test.dart
+++ b/pkg/dev_compiler/test/codegen_test.dart
@@ -12,6 +12,7 @@ library dev_compiler.test.codegen_test;
// compiles stuff. This should be changed to not use unittest and just be a
// regular program that outputs files.
+import 'dart:async';
import 'dart:io' show Directory, File, Platform;
import 'package:analyzer/analyzer.dart'
show
@@ -127,7 +128,7 @@ main(List<String> arguments) {
if (codeCoverage && !isTopLevelTest) continue;
var name = path.withoutExtension(relativePath);
- test('dartdevc $name', () {
+ test('dartdevc $name', () async {
// Check if we need to use special compile options.
var contents = new File(testFile).readAsStringSync();
var match = testFileOptionsMatcher.firstMatch(contents);
@@ -159,7 +160,7 @@ main(List<String> arguments) {
JSModuleFile module = null;
var exception, stackTrace;
try {
- module = compiler.compile(unit, options);
+ module = await compiler.compile(unit, options);
} catch (e, st) {
exception = e;
stackTrace = st;
@@ -204,8 +205,8 @@ main(List<String> arguments) {
}
if (filePattern.hasMatch('sunflower')) {
- test('sunflower', () {
- _buildSunflower(sharedCompiler, codegenOutputDir, codegenExpectDir);
+ test('sunflower', () async {
+ await _buildSunflower(sharedCompiler, codegenOutputDir, codegenExpectDir);
});
}
@@ -245,8 +246,8 @@ void _writeModule(String outPath, String expectPath, ModuleFormat format,
}
}
-void _buildSunflower(
- ModuleCompiler compiler, String outputDir, String expectDir) {
+Future<Null> _buildSunflower(
+ ModuleCompiler compiler, String outputDir, String expectDir) async {
var baseDir = path.join(codegenDir, 'sunflower');
var files = ['sunflower', 'circle', 'painter']
.map((f) => path.join(baseDir, '$f.dart'))
@@ -254,7 +255,7 @@ void _buildSunflower(
var input = new BuildUnit('sunflower', baseDir, files, _moduleForLibrary);
var options = new CompilerOptions(summarizeApi: false);
- var built = compiler.compile(input, options);
+ var built = await compiler.compile(input, options);
_writeModule(path.join(outputDir, 'sunflower', 'sunflower'),
path.join(expectDir, 'sunflower', 'sunflower'), ModuleFormat.amd, built);
}
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart ('k') | pkg/dev_compiler/test/not_yet_strong_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698