use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.
the class TestSummaryTest method testMultipleTimes.
@Test
public void testMultipleTimes() throws Exception {
String expectedString = ANY_STRING + "INFO" + ANY_STRING + BlazeTestStatus.PASSED + ANY_STRING + "\n Stats over 3 runs: max = 3.0s, min = 1.0s, " + "avg = 2.0s, dev = 0.8s";
AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
TestSummary summary = basicBuilder.addTestTimes(ImmutableList.of(1000L, 2000L, 3000L)).build();
TestSummaryPrinter.print(summary, terminalPrinter, true, false);
terminalPrinter.print(find(expectedString));
}
use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.
the class TestSummaryTest method testNoTiming.
@Test
public void testNoTiming() throws Exception {
String expectedString = ANY_STRING + "INFO" + ANY_STRING + BlazeTestStatus.PASSED;
AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
TestSummary summary = createTestSummary(stubTarget, BlazeTestStatus.PASSED, NOT_CACHED);
TestSummaryPrinter.print(summary, terminalPrinter, true, false);
terminalPrinter.print(find(expectedString));
}
use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.
the class TestSummaryTest method testSingleTime.
@Test
public void testSingleTime() throws Exception {
String expectedString = ANY_STRING + "INFO" + ANY_STRING + BlazeTestStatus.PASSED + ANY_STRING + "in 3.4s";
AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
TestSummary summary = basicBuilder.addTestTimes(ImmutableList.of(3412L)).build();
TestSummaryPrinter.print(summary, terminalPrinter, true, false);
terminalPrinter.print(find(expectedString));
}
use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.
the class TestSummaryTest method assertShouldNotPrint.
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());
}
use of com.google.devtools.build.lib.util.io.AnsiTerminalPrinter in project bazel by bazelbuild.
the class TestSummaryTest method testShouldPrintUncachedStatus.
@Test
public void testShouldPrintUncachedStatus() throws Exception {
AnsiTerminalPrinter terminalPrinter = Mockito.mock(AnsiTerminalPrinter.class);
TestSummary summary = createTestSummary(stubTarget, BlazeTestStatus.PASSED, NOT_CACHED);
TestSummaryPrinter.print(summary, terminalPrinter, true, false);
verify(terminalPrinter).print(not(contains("cached")));
}
Aggregations