Don't print BLAZE_HALTED_BEFORE_TESTING for tests that failed to build because we halted.

RELNOTES: Tests that failed to build because execution was halted no longer print their status.

--
MOS_MIGRATED_REVID=117542221
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/TestSummaryPrinter.java b/src/main/java/com/google/devtools/build/lib/runtime/TestSummaryPrinter.java
index 5003398..ee24048 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/TestSummaryPrinter.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/TestSummaryPrinter.java
@@ -93,8 +93,10 @@
       TestSummary summary,
       AnsiTerminalPrinter terminalPrinter,
       boolean verboseSummary, boolean printFailedTestCases) {
+    BlazeTestStatus status = summary.getStatus();
     // Skip output for tests that failed to build.
-    if (summary.getStatus() == BlazeTestStatus.FAILED_TO_BUILD) {
+    if (status == BlazeTestStatus.FAILED_TO_BUILD
+        || status == BlazeTestStatus.BLAZE_HALTED_BEFORE_TESTING) {
       return;
     }
     String message = getCacheMessage(summary) + statusString(summary.getStatus());
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/TestSummaryTest.java b/src/test/java/com/google/devtools/build/lib/runtime/TestSummaryTest.java
index 2a412bd..6ad3336 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/TestSummaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/TestSummaryTest.java
@@ -20,7 +20,9 @@
 import static org.junit.Assert.assertTrue;
 import static org.mockito.AdditionalMatchers.find;
 import static org.mockito.AdditionalMatchers.not;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.contains;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -122,6 +124,23 @@
     terminalPrinter.print(find(expectedString));
   }
 
+  private void assertShouldNotPrint(BlazeTestStatus status) throws Exception {
+    AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
+    TestSummaryPrinter.print(
+        createTestSummary(stubTarget, status, NOT_CACHED), terminalPrinter, true, false);
+    verify(terminalPrinter, never()).print(anyString());
+  }
+
+  @Test
+  public void testShouldNotPrintFailedToBuildStatus() throws Exception {
+    assertShouldNotPrint(BlazeTestStatus.FAILED_TO_BUILD);
+  }
+
+  @Test
+  public void testShouldNotPrintHaltedStatus() throws Exception {
+    assertShouldNotPrint(BlazeTestStatus.BLAZE_HALTED_BEFORE_TESTING);
+  }
+
   @Test
   public void testShouldPrintCachedStatus() throws Exception {
     String expectedString = ANY_STRING + "\\(cached" + ANY_STRING;