blob: 3cb5948db24e5d783b769f58b394704ba0ffe67d [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart = 2.9
/// @assertion int exitCode
/// See [exit] for more information on how to chose a value for the exit code.
/// @description Checks that exit code [-1] is processed correctly.
/// @author iarkh@unipro.ru
import "../../../Utils/expect.dart";
import "dart:io";
run_process() { exitCode = -1; }
run_main() async {
String executable = Platform.resolvedExecutable;
String eScript = Platform.script.toString();
int called = 0;
await Process.run(executable, [eScript, "run"]).then((ProcessResult results) {
Expect.equals(Platform.isWindows ? -1 : 255, results.exitCode);
called++;
});
Expect.equals(1, called);
}
main(List<String> args) {
if(args.length > 0)
run_process();
else {
run_main();
}
}