More fix for #1094: LibTest/io/Process/run_A01_t03 test corrected: exit code for precompiled runtime should be 255
diff --git a/LibTest/io/Process/run_A01_t03.dart b/LibTest/io/Process/run_A01_t03.dart
index 1476d0f..3f4eec4 100644
--- a/LibTest/io/Process/run_A01_t03.dart
+++ b/LibTest/io/Process/run_A01_t03.dart
@@ -27,19 +27,35 @@
/// zero (not success)and not 255 (not a runtime error) if invalid file path is
/// used - which is all we really know about the `dart` executable. Any other
/// error should be fine.
+/// For dartkp configuration, exit code should be 255: VM initialization failed
+/// because cannot load non-existing snapshot and runtime exception is thrown
+/// here, so exit code should be 255 here.
+///
/// @author sgrekhov@unipro.ru
/// @issue 31611
import "dart:io";
import "../../../Utils/expect.dart";
+bool isDartkp() {
+ var parts = Uri.file(Platform.resolvedExecutable).pathSegments;
+ String basename = parts[parts.length - 1];
+ var pos = basename.lastIndexOf('.');
+ String result = (pos != -1) ? basename.substring(0, pos) : basename;
+ return basename == "dart_precompiled_runtime";
+}
+
main() {
String executable = Platform.resolvedExecutable;
File file = new File.fromUri(Platform.script.resolve("not_existing.dart"));
asyncStart();
Process.run(executable, [file.path]).then((ProcessResult results) {
Expect.notEquals(0, results.exitCode);
- Expect.notEquals(255, results.exitCode);
+ if(!isDartkp()) {
+ Expect.notEquals(255, results.exitCode);
+ } else {
+ Expect.equals(255, results.exitCode);
+ }
Expect.notEquals("", results.stderr);
asyncEnd();
});