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

Unified Diff: tests/compiler/dart2js/memory_compiler.dart

Issue 2997413002: Support --use-kernel in memory_compiler (Closed)
Patch Set: Remove hack in source_loader Created 3 years, 4 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 | « tests/compiler/dart2js/kernel/visitor_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/memory_compiler.dart
diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
index 3d758f1cd3b86340b01ae6700ff879e7028839ee..234371731fe0154222ccc85b79966bf1a9809337 100644
--- a/tests/compiler/dart2js/memory_compiler.dart
+++ b/tests/compiler/dart2js/memory_compiler.dart
@@ -14,6 +14,7 @@ import 'package:compiler/compiler_new.dart'
CompilerOutput,
Diagnostic,
PackagesDiscoveryProvider;
+import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/diagnostics/messages.dart' show Message;
import 'package:compiler/src/elements/entities.dart'
show LibraryEntity, MemberEntity;
@@ -84,11 +85,7 @@ Future<CompilationResult> runCompiler(
PackagesDiscoveryProvider packagesDiscoveryProvider,
void beforeRun(CompilerImpl compiler)}) async {
if (entryPoint == null) {
- if (options.contains('--read-dill')) {
- entryPoint = Uri.parse('memory:main.dill');
- } else {
- entryPoint = Uri.parse('memory:main.dart');
- }
+ entryPoint = Uri.parse('memory:main.dart');
}
CompilerImpl compiler = compilerFor(
entryPoint: entryPoint,
@@ -122,7 +119,16 @@ CompilerImpl compilerFor(
Uri packageRoot,
Uri packageConfig,
PackagesDiscoveryProvider packagesDiscoveryProvider}) {
- Uri libraryRoot = Uri.base.resolve('sdk/');
+ Uri libraryRoot;
+ if (options.contains(Flags.useKernel)) {
+ String buildDir = Platform.isMacOS ? 'xcodebuild' : 'out';
+ String configuration =
+ Platform.environment['DART_CONFIGURATION'] ?? 'ReleaseX64';
+ libraryRoot = Uri.base.resolve('$buildDir/$configuration/dart-sdk/');
+ } else {
+ libraryRoot = Uri.base.resolve('sdk/');
+ }
+
if (packageRoot == null &&
packageConfig == null &&
packagesDiscoveryProvider == null) {
@@ -256,3 +262,9 @@ DiagnosticHandler createDiagnosticHandler(DiagnosticHandler diagnosticHandler,
}
return handler;
}
+
+main() {
+ runCompiler(
+ memorySourceFiles: {'main.dart': 'main() {}'},
+ options: [Flags.useKernel]);
+}
« no previous file with comments | « tests/compiler/dart2js/kernel/visitor_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698