diff options
author | nea <nea@nea.moe> | 2023-08-10 18:01:37 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-08-10 18:01:37 +0200 |
commit | 873864974127ec4f123c7db0560235e806c3faab (patch) | |
tree | c1d39786d89dd39f7843a73c2d69e75a12894b36 /test | |
parent | 0ab6dab185e31fcf6f3e0cf98dc8496f02448ee8 (diff) | |
download | nealisp-873864974127ec4f123c7db0560235e806c3faab.tar.gz nealisp-873864974127ec4f123c7db0560235e806c3faab.tar.bz2 nealisp-873864974127ec4f123c7db0560235e806c3faab.zip |
Add test junit formatter
Diffstat (limited to 'test')
-rw-r--r-- | test/res/test.lisp | 7 | ||||
-rw-r--r-- | test/src/TestLisp.kt | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/test/res/test.lisp b/test/res/test.lisp index f3b870c..eea180c 100644 --- a/test/res/test.lisp +++ b/test/res/test.lisp @@ -24,9 +24,10 @@ (debuglog "============") (debuglog "Running tests") -(import :ntest) -(ntest.test "Funny test" (seq +(import :test) +(test.test "Funny test" (seq (debuglog "Funny test running") - (debuglog ((ntest.fail "Test failed"))))) + ((test.assert false "False failed")) + ((test.fail "Test failed")))) 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() } |