From 69f8367389c9d6f60ca594053d9d470e5a8ec999 Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 11 Aug 2023 02:26:00 +0200 Subject: Add output capture and more test reports --- build.gradle.kts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 48834ea..c0e28f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,3 +13,32 @@ publishing { } } } + +val testReportFile = layout.buildDirectory.file("test-results/nealisp/results.xml") + +tasks.create("testLisps", JavaExec::class) { + javaLauncher.set(javaToolchains.launcherFor(java.toolchain)) + classpath(sourceSets.test.get().runtimeClasspath) + mainClass.set("TestMain") + dependsOn(tasks.testClasses) + dependsOn(tasks.processTestResources) + outputs.file(testReportFile) + systemProperty("test.report", testReportFile.map { it.asFile.absolutePath }.get()) + systemProperty("test.suites", "test") + systemProperty("test.imports", "secondary") + group = "verification" +} + + +tasks.create("testLispsHtml", Exec::class) { + dependsOn("testLisps") + executable("xunit-viewer") + inputs.file(testReportFile) + val testReportHtmlFile = layout.buildDirectory.file("reports/nealisp/tests/index.html") + outputs.file(testReportHtmlFile) + args( + "-r", testReportFile.map { it.asFile.absolutePath }.get(), + "-o", testReportHtmlFile.map { it.asFile.absolutePath }.get() + ) + group = "verification" +} -- cgit