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/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;