OLD | NEW |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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", | 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 } |
OLD | NEW |