Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 有没有办法通过命令行跳过特定的测试用例?_Ant - Fatal编程技术网

Ant 有没有办法通过命令行跳过特定的测试用例?

Ant 有没有办法通过命令行跳过特定的测试用例?,ant,Ant,我正在使用ApacheAnt,不想更改我的源代码测试,但我想选择关闭一个。我知道可以只运行您选择的测试(-Dtestcase=whatever),但我不确定是否可以排除一个测试。您可以使用ant-DexcludedTest=SomeExcludedTest并将批处理测试配置为这样: <batchtest ...> <!-- define the excludedTest property to an unexisting test name in case

我正在使用ApacheAnt,不想更改我的源代码测试,但我想选择关闭一个。我知道可以只运行您选择的测试(-Dtestcase=whatever),但我不确定是否可以排除一个测试。

您可以使用
ant-DexcludedTest=SomeExcludedTest
并将批处理测试配置为这样:

<batchtest ...>
    <!-- define the excludedTest property to an unexisting test name in case 
         nothing is passed as a system property -->
    <property name="excludedTest" value="THIS_TEST_NAME_DOES_NOT_EXIST"/>
    <fileset dir="${src.tests}">
        <include name="**/*Test.java"/>
        <exclude name="**/${excludedTest}.java"/>
    </fileset>
</batchtest>