From 873864974127ec4f123c7db0560235e806c3faab Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 10 Aug 2023 18:01:37 +0200 Subject: Add test junit formatter --- test/src/TestLisp.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/src/TestLisp.kt') diff --git a/test/src/TestLisp.kt b/test/src/TestLisp.kt index fa90468..1f0c424 100644 --- a/test/src/TestLisp.kt +++ b/test/src/TestLisp.kt @@ -1,9 +1,12 @@ import moe.nea.lisp.LispExecutionContext import moe.nea.lisp.LispParser +import moe.nea.lisp.TestResultFormatter import java.io.File +import javax.xml.stream.XMLOutputFactory object T + fun main() { val otherP = LispParser.parse(File(T::class.java.getResource("/test.lisp")!!.file)) val executionContext = LispExecutionContext() @@ -13,5 +16,9 @@ fun main() { LispParser.parse(File(T::class.java.getResource("/secondary.lisp")!!.file)) ) val bindings = executionContext.genBindings() - println("The results are in: ${executionContext.runTests(otherP, bindings)}") + val testResults = executionContext.runTests(otherP, "Test", bindings) + val w = XMLOutputFactory.newFactory() + .createXMLStreamWriter(File("TestOutput.xml").bufferedWriter()) + TestResultFormatter.write(w, listOf(testResults)) + w.close() } -- cgit