summaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-08-11 02:26:00 +0200
committernea <nea@nea.moe>2023-08-11 02:26:00 +0200
commit69f8367389c9d6f60ca594053d9d470e5a8ec999 (patch)
tree4fe2d341ca9ec9b8aaa0ec5cb18c53bf63265844 /build.gradle.kts
parent912c9918d9a5afbfb023b650bed6e2754f030d5e (diff)
downloadnealisp-69f8367389c9d6f60ca594053d9d470e5a8ec999.tar.gz
nealisp-69f8367389c9d6f60ca594053d9d470e5a8ec999.tar.bz2
nealisp-69f8367389c9d6f60ca594053d9d470e5a8ec999.zip
Add output capture and more test reports
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts29
1 files changed, 29 insertions, 0 deletions
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"
+}