Skip to content

Commit 22551d3

Browse files
jensjohacommit-bot@chromium.org
authored andcommitted
[CFE/dart2js] Don't set exit code to 1 in unit tests running analyzer
The testing system - sometimes (see http://dartbug.com/45408) - exits and turns the bot purple when the exit-code from a test is (e.g.) 1. This CL removes some instances of having an exit code of 1. Change-Id: Ic831d151346a28dabe9180e80a8e462af227bf41 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192381 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent 0de315c commit 22551d3

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

pkg/compiler/test/analyses/analyze_test.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
// @dart = 2.7
66

7+
import 'dart:io' show exitCode;
8+
79
import "package:testing/src/run_tests.dart" as testing show main;
810

9-
main() {
11+
main() async {
1012
// This method is async, but keeps a port open to prevent the VM from exiting
1113
// prematurely.
12-
return testing.main(
14+
await testing.main(
1315
<String>["--config=pkg/compiler/testing.json", "--verbose", "analyze"]);
16+
if (exitCode != 0) {
17+
throw "Exit-code was $exitCode!";
18+
}
1419
}

pkg/front_end/test/fasta/analyze_git_test.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
// @dart = 2.9
66

7+
import 'dart:io' show exitCode;
8+
79
import "package:testing/src/run_tests.dart" as testing show main;
810

9-
main() {
11+
main() async {
1012
// This method is async, but keeps a port open to prevent the VM from exiting
1113
// prematurely.
1214
// Note: if you change this file, also change
1315
// pkg/compiler/test/analyses/analyze_test.dart
14-
return testing.main(
16+
await testing.main(
1517
<String>["--config=pkg/front_end/testing.json", "--verbose", "analyze"]);
18+
if (exitCode != 0) {
19+
throw "Exit-code was $exitCode!";
20+
}
1621
}

pkg/front_end/test/fasta/analyze_src_with_lints_git_test.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44

55
// @dart = 2.9
66

7+
import 'dart:io' show exitCode;
8+
79
import "package:testing/src/run_tests.dart" as testing show main;
810

911
main() async {
10-
return await testing.main(<String>[
12+
await testing.main(<String>[
1113
"--config=pkg/front_end/testing_with_lints.json",
1214
"--verbose",
1315
"analyze"
1416
]);
17+
if (exitCode != 0) {
18+
throw "Exit-code was $exitCode!";
19+
}
1520
}

0 commit comments

Comments
 (0)