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

Side by Side Diff: tests/standalone/precompilation_test.dart

Issue 1584443002: VM: Precompiled rodata snapshot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: compute string hash if necessary Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « tests/standalone/precompilation_dart2js_test.dart ('k') | tools/precompilation/test_linux.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test generating and running a simple precompiled snapshot of this script. 5 // Test generating and running a simple precompiled snapshot of this script.
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 main(List args) { 9 main(List args) {
10 if (args.length > 0 && args[0] == "--hello") { 10 if (args.length > 0 && args[0] == "--hello") {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (result.exitCode != 0) { 67 if (result.exitCode != 0) {
68 throw "$cc --version failed."; 68 throw "$cc --version failed.";
69 } 69 }
70 } catch(e) { 70 } catch(e) {
71 print("Skipping test because $cc is not present: $e"); 71 print("Skipping test because $cc is not present: $e");
72 return; 72 return;
73 } 73 }
74 74
75 result = Process.runSync( 75 result = Process.runSync(
76 cc, 76 cc,
77 [shared, cc_flags, "-o", libname, "precompiled.S"], 77 [shared, cc_flags, "-nostartfiles", "-o", libname, "precompiled.S"],
78 workingDirectory: tmp.path); 78 workingDirectory: tmp.path);
79 if (result.exitCode != 0) { 79 if (result.exitCode != 0) {
80 print(result.stdout); 80 print(result.stdout);
81 print(result.stderr); 81 print(result.stderr);
82 throw "Shared library creation failed!"; 82 throw "Shared library creation failed!";
83 } 83 }
84 84
85 var ld_library_path = new String.fromEnvironment("LD_LIBRARY_PATH"); 85 var ld_library_path = new String.fromEnvironment("LD_LIBRARY_PATH");
86 ld_library_path = "${ld_library_path}:${tmp.path}"; 86 ld_library_path = "${ld_library_path}:${tmp.path}";
87 87
88 result = Process.runSync( 88 result = Process.runSync(
89 "${dart_executable}_precompiled_runtime", 89 "${dart_executable}_precompiled_runtime",
90 ["--run-precompiled-snapshot", "ignored_script", "--hello"], 90 ["--run-precompiled-snapshot", "ignored_script", "--hello"],
91 workingDirectory: tmp.path, 91 workingDirectory: tmp.path,
92 environment: {"LD_LIBRARY_PATH": ld_library_path}); 92 environment: {"LD_LIBRARY_PATH": ld_library_path});
93 if (result.exitCode != 0) { 93 if (result.exitCode != 0) {
94 print(result.stdout); 94 print(result.stdout);
95 print(result.stderr); 95 print(result.stderr);
96 throw "Precompiled binary failed."; 96 throw "Precompiled binary failed.";
97 } 97 }
98 print(result.stdout); 98 print(result.stdout);
99 if (result.stdout != "Hello\n") { 99 if (result.stdout != "Hello\n") {
100 throw "Precompiled binary output mismatch."; 100 throw "Precompiled binary output mismatch.";
101 } 101 }
102 } finally { 102 } finally {
103 tmp?.deleteSync(recursive: true); 103 tmp?.deleteSync(recursive: true);
104 } 104 }
105 } 105 }
OLDNEW
« no previous file with comments | « tests/standalone/precompilation_dart2js_test.dart ('k') | tools/precompilation/test_linux.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698