diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleProperties.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleProperties.java index 685b71e23aec..977a28fb14e7 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleProperties.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleProperties.java @@ -45,27 +45,44 @@ import org.jetbrains.annotations.Nullable; public class SMTRunnerConsoleProperties extends TestConsoleProperties implements SMStacktraceParser { private final RunConfiguration myConfiguration; protected final CompositeFilter myCustomFilter; + private final boolean myPrintTestingStartedTime; /** * @param config * @param testFrameworkName Prefix for storage which keeps runner settings. E.g. "RubyTestUnit" * @param executor */ - public SMTRunnerConsoleProperties(@NotNull final RunConfiguration config, - @NotNull final String testFrameworkName, - @NotNull final Executor executor) - { + public SMTRunnerConsoleProperties(@NotNull RunConfiguration config, + @NotNull String testFrameworkName, + @NotNull Executor executor) { + this(config, testFrameworkName, executor, true); + } + + /** + * @param config + * @param testFrameworkName Prefix for storage which keeps runner settings. E.g. "RubyTestUnit" + * @param executor + */ + public SMTRunnerConsoleProperties(@NotNull RunConfiguration config, + @NotNull String testFrameworkName, + @NotNull Executor executor, + boolean printTestingStartedTime) { super(new Storage.PropertiesComponentStorage(testFrameworkName + "Support.", PropertiesComponent.getInstance()), config.getProject(), executor); myConfiguration = config; myCustomFilter = new CompositeFilter(config.getProject()); + myPrintTestingStartedTime = printTestingStartedTime; } public RunConfiguration getConfiguration() { return myConfiguration; } + public boolean isPrintTestingStartedTime() { + return myPrintTestingStartedTime; + } + @Override public Navigatable getErrorNavigatable(@NotNull final Project project, final @NotNull String stacktrace) { if (myCustomFilter.isEmpty()) { diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java index b2ea38028776..8277151a2ca5 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java @@ -19,10 +19,7 @@ import com.intellij.execution.configurations.RunConfiguration; import com.intellij.execution.runners.ExecutionEnvironment; import com.intellij.execution.testframework.*; import com.intellij.execution.testframework.sm.SMRunnerUtil; -import com.intellij.execution.testframework.sm.runner.SMTRunnerEventsListener; -import com.intellij.execution.testframework.sm.runner.SMTRunnerTreeBuilder; -import com.intellij.execution.testframework.sm.runner.SMTRunnerTreeStructure; -import com.intellij.execution.testframework.sm.runner.SMTestProxy; +import com.intellij.execution.testframework.sm.runner.*; import com.intellij.execution.testframework.sm.runner.ui.statistics.StatisticsPanel; import com.intellij.execution.testframework.ui.AbstractTestTreeBuilder; import com.intellij.execution.testframework.ui.TestResultsPanel; @@ -217,9 +214,15 @@ public class SMTestRunnerResultsForm extends TestResultsPanel selectAndNotify(myTestsRootNode); myStartTime = System.currentTimeMillis(); - myTestsRootNode.addSystemOutput("Testing started at " - + DateFormatUtil.formatTime(myStartTime) - + " ...\n"); + boolean printTestingStartedTime = true; + if (myConsoleProperties instanceof SMTRunnerConsoleProperties) { + printTestingStartedTime = ((SMTRunnerConsoleProperties) myConsoleProperties).isPrintTestingStartedTime(); + } + if (printTestingStartedTime) { + myTestsRootNode.addSystemOutput("Testing started at " + + DateFormatUtil.formatTime(myStartTime) + + " ...\n"); + } updateStatusLabel(false); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java index 4e85c6cc384d..0682c4f38b64 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java @@ -398,7 +398,7 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { final MockPrinter mockPrinter1 = new MockPrinter(true); mockPrinter1.onNewAvailable(myTest1); - assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 ", "\nignored msg\n"); + assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 ", "\nignored msg"); //other output order final SMTestProxy myTest2 = startTestWithPrinter("my_test2"); @@ -406,10 +406,10 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false)); myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test2", "ignored msg", null)); - assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 ", "\nignored msg\n"); + assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 ", "\nignored msg"); final MockPrinter mockPrinter2 = new MockPrinter(true); mockPrinter2.onNewAvailable(myTest2); - assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 ", "\nignored msg\n"); + assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 ", "\nignored msg"); } public void testProcessor_OnIgnored_WithStacktrace() {