[testing] Allow pkg/front_end tests to fail with exit code 1

The test runner expects VM tests to exit with a compile error or
an uncaught exception, which have special exit codes.
Some front end tests fail by explicitly exiting with exit code 1.
Recognize these tests as test failures, and not as failures
of the test infrastructure.

Change-Id: Ib89d89c69f0e4f289fde0f762a7dd47dad446953
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249820
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
diff --git a/pkg/test_runner/lib/src/command_output.dart b/pkg/test_runner/lib/src/command_output.dart
index 807b974e..5e78325 100644
--- a/pkg/test_runner/lib/src/command_output.dart
+++ b/pkg/test_runner/lib/src/command_output.dart
@@ -852,6 +852,7 @@
   static const _uncaughtExceptionExitCode = 255;
   static const _adbInfraFailureCodes = [10];
   static const _ubsanFailureExitCode = 1;
+  static const _frontEndTestExitCode = 1;
 
   VMCommandOutput(Command command, int exitCode, bool timedOut,
       List<int> stdout, List<int> stderr, Duration time, int pid)
@@ -909,10 +910,14 @@
     // The actual outcome depends on the exitCode.
     if (exitCode == _compileErrorExitCode) return Expectation.compileTimeError;
     if (exitCode == _uncaughtExceptionExitCode) return Expectation.runtimeError;
-    if ((exitCode == _ubsanFailureExitCode) &&
-        (testCase.configuration.sanitizer == Sanitizer.ubsan)) {
+    if (exitCode == _ubsanFailureExitCode &&
+        testCase.configuration.sanitizer == Sanitizer.ubsan) {
       return Expectation.fail;
     }
+    if (exitCode == _frontEndTestExitCode &&
+        testCase.displayName.startsWith('pkg/front_end/test/')) {
+      return Expectation.runtimeError;
+    }
     if (exitCode != 0) {
       var ourExit = 5;
       // Unknown nonzero exit code from vm command.