mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
allow to disable "Testing started at <TIME>..." printing on test run
This commit is contained in:
+21
-4
@@ -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()) {
|
||||
|
||||
+10
-7
@@ -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);
|
||||
|
||||
|
||||
+3
-3
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user