Testing 如何从一个gradle任务中执行多个testng测试套件xml

Testing 如何从一个gradle任务中执行多个testng测试套件xml,testing,gradle,Testing,Gradle,我写了一个梯度任务。从这个任务中,我运行了testng测试套件,如下所示 任务类型:JavaExec{ classpath += files('conf') main = 'org.testng.TestNG' enter code here args '-testjar', 'build/libs/*.jar' ,'-xmlpathinjar','testsuites/abc.xml', '-d' , reportFolder classpath +=configurations.runt

我写了一个梯度任务。从这个任务中,我运行了testng测试套件,如下所示

任务类型:JavaExec{

classpath += files('conf')

main = 'org.testng.TestNG'
enter code here

args '-testjar', 'build/libs/*.jar' ,'-xmlpathinjar','testsuites/abc.xml', '-d' , reportFolder
classpath +=configurations.runtime
systemProperties 'logDir': logFolder
systemProperties 'testReportOutputFolder': reportFolder
systemProperties 'executionSummaryReportName': executionSummaryReportName
systemProperties 'com.tc.productkey.path': licenseFile
ignoreExitValue = 'true'
}

xml是我的测试套件。我想在同一个任务中再运行一个套件,即xyz.xml,它也存在于同一个testsuite文件夹中

我试过了

args '-testjar', 'build/libs/*.jar' ,'-xmlpathinjar','testsuites/abc.xml' 'testsuites/xyz.xml', '-d' , reportFolder

但它没有起作用。你们能帮忙吗。

为什么不使用Gradle的测试任务?@PeterNiederwieser:为了设计起见,我可以在Gradle文件中有很多这样的任务。你也可以有很多测试任务。测试是一种更强大、更惯用的运行测试的方法。从我在文档中看到的情况来看,运行多个TestNG套件也很容易。好的,我将尝试探索这项任务: