2012-06-15 45 views
2

我有一個簡單的Ant構建文件來生成XML格式的JUnit測試報告(見下文)。這會生成一個報告,其中包含stdout和stderr中每個測試方法的輸出(如果有)。我希望將兩個流的輸出合併爲一個測試方法。但我不知道如何做到這一點;我如何告訴JUnit目標將stderr重定向到stdout?如何將stderr重定向到Ant JUnit目標中的stdout?

<target name="test" depends="compile"> 
    <junit> 
     <classpath refid="classpath.tests"/> 
     <formatter type="xml"/> 
     <test name="tests.Tests1"/> 
     <test name="tests.Tests2"/> 
    </junit> 
</target> 

回答

0
ant test | grep -w junit 2>&1 

備用選項:與q選項運行Ant。

ant -q test 
相關問題