本文整理了Java中org.gradle.api.tasks.testing.Test.getReports()
方法的一些代码示例,展示了Test.getReports()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Test.getReports()
方法的具体详情如下:
包路径:org.gradle.api.tasks.testing.Test
类名称:Test
方法名:getReports
暂无
代码示例来源:origin: SonarSource/sonar-scanner-gradle
private static void configureTestReports(Test testTask, Map<String, Object> properties) {
File testResultsDir = testTask.getReports().getJunitXml().getDestination();
// do not set a custom test reports path if it does not exists, otherwise SonarQube will emit an error
// do not set a custom test reports path if there are no files, otherwise SonarQube will emit a warning
if (testResultsDir.isDirectory()
&& asList(testResultsDir.list()).stream().anyMatch(file -> TEST_RESULT_FILE_PATTERN.matcher(file).matches())) {
appendProp(properties, "sonar.junit.reportPaths", testResultsDir);
// For backward compatibility
appendProp(properties, "sonar.junit.reportsPath", testResultsDir);
appendProp(properties, "sonar.surefire.reportsPath", testResultsDir);
}
}
代码示例来源:origin: org.sonarsource.scanner.gradle/sonarqube-gradle-plugin
private static void configureTestReports(Test testTask, Map<String, Object> properties) {
File testResultsDir = testTask.getReports().getJunitXml().getDestination();
// do not set a custom test reports path if it does not exists, otherwise SonarQube will emit an error
// do not set a custom test reports path if there are no files, otherwise SonarQube will emit a warning
if (testResultsDir.isDirectory()
&& asList(testResultsDir.list()).stream().anyMatch(file -> TEST_RESULT_FILE_PATTERN.matcher(file).matches())) {
appendProp(properties, "sonar.junit.reportPaths", testResultsDir);
// For backward compatibility
appendProp(properties, "sonar.junit.reportsPath", testResultsDir);
appendProp(properties, "sonar.surefire.reportsPath", testResultsDir);
}
}
代码示例来源:origin: palantir/gradle-baseline
private void configurePluginsForArtifacts(Project project) {
String circleArtifactsDir = System.getenv("CIRCLE_ARTIFACTS");
if (circleArtifactsDir == null) {
project.getLogger().info("$CIRCLE_ARTIFACTS variable is not set, not configuring junit/profiling reports");
return;
}
try {
Files.createDirectories(Paths.get(circleArtifactsDir), PERMS_ATTRIBUTE);
} catch (IOException e) {
throw new RuntimeException("failed to create CIRCLE_ARTIFACTS directory", e);
}
project.getRootProject().allprojects(proj ->
proj.getTasks().withType(Test.class, test -> {
test.getReports().getHtml().setEnabled(true);
test.getReports().getHtml().setDestination(junitPath(circleArtifactsDir, test.getPath()));
}));
}
代码示例来源:origin: gradle.plugin.com.intershop.gradle.plugin.azure/azurePlugin
@Override
void configure(Task task)
{
super.configure(task);
Task prepareMonitorEnvTask = project.getTasks().findByName(AzurePlugin.PREPARE_MONITOR_ENV_TASK);
Test t = (Test)task;
t.setDescription("Test execution of the azureTest source set against production deployment.");
t.dependsOn(prepareMonitorEnvTask);
t.setClasspath(sourceSet.getRuntimeClasspath());
t.setTestClassesDirs(sourceSet.getOutput().getClassesDirs());
t.systemProperty("testEnvPath", azure.getMonitorEnvFile().get().getAsFile().getAbsolutePath());
t.setBinResultsDir(new File(project.getBuildDir(), "monitor-test-results/binary/test"));
t.getReports().getHtml().setDestination(new File(project.getBuildDir(), "reports/monitor-test-results" ));
t.getReports().getJunitXml().setDestination(new File(project.getBuildDir(), "monitor-test-results" ));
}
}
代码示例来源:origin: palantir/gradle-baseline
test.getReports().getJunitXml().setEnabled(true);
test.getReports().getJunitXml().setDestination(junitPath(circleReportsDir, test.getPath()));
});
proj.getTasks().withType(Checkstyle.class, checkstyle ->
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
TestTaskReports testTaskReports = runTestsTask.getReports();
内容来源于网络,如有侵权,请联系作者删除!