2

我的测试目标如下所示:

<target name="test" depends="compileTest">
    <junit haltonfailure="yes">
        <classpath>
            <pathelement location="bin" />
            <pathelement location="lib/xstream-1.4.2.jar" />
            <pathelement location="lib/jettison-1.2.jar" />
        </classpath>
        <formatter type="plain" usefile="false" />

        <batchtest>
            <fileset dir="${test-src}">
                <include name="**/*Test*" />
            </fileset>
        </batchtest>
    </junit>
</target>

输出如下所示:

test:
    [junit] Testsuite: app.commons.error.test.ShellErrorMessageTest
    [junit] Tests run: 9, Failures: 0, Errors: 0, Time elapsed: 0.006 sec
    [junit] Testcase: testCreateNormal took 0.003 sec
    [junit] Testcase: testGetSectionSeparatorLine took 0.001 sec
    [junit] Testcase: testGetSectionSeparatorLineMultipleSymbols took 0 sec
    [junit] Testcase: testGetSectionSeparatorLineEmptySymbol took 0 sec
    [junit] Testcase: testGetSectionSeparatorLineEmptySymbolSpace took 0 sec
    [junit] Testcase: testGetSectionSeparatorLineNull took 0 sec

如何将此输出折叠为 1 行摘要?

有没有办法按照“运行 500 次测试。0 次失败。0 次错误”这一行接收 1 行输出

4

1 回答 1

1

您可以通过添加来设置不详细的junit输出

 <formatter type="brief" usefile="false"/>

<junit>

为了进一步减少它,我想到了以下选项:

于 2012-04-15T21:06:17.560 回答