mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
output: don't postpone failure output
This commit is contained in:
@@ -532,6 +532,19 @@ public class SMTestProxy extends AbstractTestProxy {
|
||||
return filterChildren(filter, getChildren());
|
||||
}
|
||||
|
||||
protected void addAfterLastPassed(Printable printable) {
|
||||
int idx = 0;
|
||||
synchronized (myNestedPrintables) {
|
||||
for (Printable proxy : myNestedPrintables) {
|
||||
if (proxy instanceof SMTestProxy && !((SMTestProxy)proxy).isFinal()) {
|
||||
break;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
insert(printable, idx);
|
||||
}
|
||||
|
||||
private static List<? extends SMTestProxy> filterChildren(@Nullable Filter<? super SMTestProxy> filter,
|
||||
List<? extends SMTestProxy> allChildren) {
|
||||
if (filter == Filter.NO_FILTER || filter == null) {
|
||||
|
||||
+20
@@ -40,6 +40,26 @@ class OutputTest : BaseSMTRunnerTestCase() {
|
||||
assertEquals("inside test\n", printer.stdOut)
|
||||
}
|
||||
|
||||
fun testBeforeAfterFailedOrder() {
|
||||
val suite = createTestProxy("parent")
|
||||
val child = createTestProxy("child", suite)
|
||||
|
||||
suite.addStdOutput("before test started\n", ProcessOutputTypes.STDOUT)
|
||||
child.setStarted()
|
||||
child.addStdOutput("inside test\n", ProcessOutputTypes.STDOUT)
|
||||
child.setTestFailed("fail", null, false)
|
||||
suite.addStdOutput("after test finished\n", ProcessOutputTypes.STDOUT)
|
||||
|
||||
val printer = MockPrinter(true)
|
||||
suite.printOn(printer)
|
||||
|
||||
assertEquals("before test started\ninside test\nafter test finished\n", printer.stdOut)
|
||||
printer.resetIfNecessary()
|
||||
|
||||
child.printOn(printer)
|
||||
assertEquals("inside test\n", printer.stdOut)
|
||||
}
|
||||
|
||||
fun testBeforeAfterOrderWhenFlushed() {
|
||||
val suite = createTestProxy("parent")
|
||||
val child = createTestProxy("child", suite)
|
||||
|
||||
@@ -149,19 +149,6 @@ public abstract class AbstractTestProxy extends CompositePrintable {
|
||||
return provider == null ? Collections.<DiffHyperlink>emptyList() : Collections.singletonList(provider);
|
||||
}
|
||||
|
||||
protected void addAfterLastPassed(Printable printable) {
|
||||
int idx = 0;
|
||||
synchronized (myNestedPrintables) {
|
||||
for (Printable proxy : myNestedPrintables) {
|
||||
if (proxy instanceof AbstractTestProxy && !((AbstractTestProxy)proxy).isPassed()) {
|
||||
break;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
insert(printable, idx);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public DiffHyperlink getDiffViewerProvider() {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user