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

Unified Diff: tests/standalone/precompilation_dart2js_test.dart

Issue 1430993003: Add test precompiling dart2js. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: status file Created 5 years, 1 month 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 | « runtime/vm/snapshot.cc ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/precompilation_dart2js_test.dart
diff --git a/tests/standalone/precompilation_test.dart b/tests/standalone/precompilation_dart2js_test.dart
similarity index 80%
copy from tests/standalone/precompilation_test.dart
copy to tests/standalone/precompilation_dart2js_test.dart
index 047ac0d5c6ba00c765ba178e92a21587c0e2d889..c961a5e36c2b9ed4a92270655857621efc4cbc61 100644
--- a/tests/standalone/precompilation_test.dart
+++ b/tests/standalone/precompilation_dart2js_test.dart
@@ -43,15 +43,18 @@ main(List args) {
return;
}
+ var abs_package_root = new File(Platform.packageRoot).absolute.path;
var dart_executable =
Directory.current.path + Platform.pathSeparator + Platform.executable;
Directory tmp;
try {
tmp = Directory.current.createTempSync("temp_precompilation_test");
- var result = Process.runSync(
- "${dart_executable}_no_snapshot",
- ["--gen-precompiled-snapshot", Platform.script.path],
- workingDirectory: tmp.path);
+ var exec = "${dart_executable}_no_snapshot";
+ var args = ["--package-root=$abs_package_root",
+ "--gen-precompiled-snapshot",
+ "${abs_package_root}compiler/src/dart2js.dart"];
+ print("$exec ${args.join(' ')}");
+ var result = Process.runSync(exec, args, workingDirectory: tmp.path);
if (result.exitCode != 0) {
print(result.stdout);
print(result.stderr);
@@ -84,10 +87,10 @@ main(List args) {
var ld_library_path = new String.fromEnvironment("LD_LIBRARY_PATH");
ld_library_path = "${ld_library_path}:${tmp.path}";
-
- result = Process.runSync(
- "${dart_executable}",
- ["--run-precompiled-snapshot", "ignored_script", "--hello"],
+ exec = "${dart_executable}";
+ args = ["--run-precompiled-snapshot", "ignored_script", "--version"];
+ print("LD_LIBRARY_PATH=$ld_library_path $exec ${args.join(' ')}");
+ result = Process.runSync(exec, args,
workingDirectory: tmp.path,
environment: {"LD_LIBRARY_PATH": ld_library_path});
if (result.exitCode != 0) {
@@ -96,7 +99,7 @@ main(List args) {
throw "Precompiled binary failed.";
}
print(result.stdout);
- if (result.stdout != "Hello\n") {
+ if (!result.stdout.contains("Dart-to-JavaScript compiler")) {
throw "Precompiled binary output mismatch.";
}
} finally {
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698