Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-junit-xml Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:45:12 2022 GMT+0.
Next: Systems, Previous: The cl-junit-xml Reference Manual, Up: The cl-junit-xml Reference Manual [Contents][Index]
Small library for writing junit-compatible XML files.
CL-JUNIT-XML> (let* ((junit (make-junit))
(suite (add-child junit (make-testsuite "suite" :timestamp "now"))))
(add-child suite (make-testcase "test" "class" 1.0
:failure "invalid assertion"))
(add-child suite (make-testcase "test 2" "class" 2.0
:error "problem running the test"))
(add-child suite (make-testcase "test 3" "class" 5.0))
(write-xml junit T :pretty-p T))
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="suite" timestamp="now" id="0" tests="3" errors="1" failures="1" time="8.0">
<testcase name="test 3" classname="class" time="5.0"/>
<testcase name="test 2" classname="class" time="2.0">
<error>
<![CDATA[problem running the test]]></error>
</testcase>
<testcase name="test" classname="class" time="1.0">
<failure>
<![CDATA[invalid assertion]]></failure>
</testcase>
</testsuite>
make-junit
creates a new junit root XML object you can add suites to
make-testsuite
creates a new junit testsuite add testcases to
make-testcase
creates a new junit testcase
(add-child parent child)
add cases to suites, and suites to junit. returns the child
(write-xml junit sink &key pretty-p &allow-other-keys)
writes the junit XML to the given sink. Supports sinks of:
nil
- returs the XML as a stringT
- writes the XML to *standard-output*
if pretty-p
is non-nil, then the XML produced is indented.
Other keys are allowed to support integration with other testing libraries.
lisp-unit2 support is available via the cl-junit-xml.lisp-unit2
ASDF system, and adds some additional write-xml
specializations for
lisp-unit2 objects.
Any dots (.
) in test names will be read as part of the classname
for junit, which affects rendering in systems like Jenkins.
For example, assuming you start with (lisp-unit2:run-tests :name :my-tests)
:
frobs
will appear in junit as package MY-TESTS
, class
MY-TESTS.root
, name frobs
foo.frobs
will appear in junit as package MY-TESTS
,
class MY-TESTS.FOO
, name foo.frobs
(write-xml (lisp-unit2:run-tests :name :my-tests) T :pretty-p T)
(handler-bind
((lisp-unit2:all-tests-complete
#'(lambda (c)
(write-xml c T :pretty-p T))))
(lisp-unit2:run-tests :name :my-tests))
lisp-unit support is available via the cl-junit-xml.lisp-unit
ASDF system, and adds some additional write-xml
specializations for
lisp-unit objects.
Adds a :name
keyword arg to write-xml
that will be used as the
default XML classname
.
Classname handling is similar to lisp-unit2. For example, assuming you
start with (write-xml test-results T :name :my-tests)
:
frobs
will appear in junit as package MY-TESTS
, class
MY-TESTS.root
, name frobs
foo.frobs
will appear in junit as package MY-TESTS
,
class MY-TESTS.FOO
, name foo.frobs
(handler-bind
((lisp-unit:tests-run-complete
#'(lambda (c)
(write-xml c T :pretty-p T :name "my-tests"))))
(lisp-unit:signal-results)
(lisp-unit:run-tests))
Next: Files, Previous: Introduction, Up: The cl-junit-xml Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Small library for writing junit XML files
Ryan Davis <ryan@acceleration.net>
MIT
Next: Packages, Previous: Systems, Up: The cl-junit-xml Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: cl-junit-xml/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
cl-junit-xml (system).
Next: cl-junit-xml/cl-junit-xml.lisp, Previous: cl-junit-xml/cl-junit-xml.asd, Up: Lisp [Contents][Index]
cl-junit-xml (system).
Previous: cl-junit-xml/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
cl-junit-xml (system).
Next: Definitions, Previous: Files, Up: The cl-junit-xml Reference Manual [Contents][Index]
Packages are listed by definition order.
Next: Indexes, Previous: Packages, Up: The cl-junit-xml Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Generic functions, Previous: Public Interface, Up: Public Interface [Contents][Index]
Next: Standalone methods, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
write the junit to the given sink (string, pathname, T, nil)
Previous: Generic functions, Up: Public Interface [Contents][Index]
automatically generated reader method
Previous: Public Interface, Up: Definitions [Contents][Index]
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
name.
automatically generated reader method
name.
automatically generated reader method
pkg.
automatically generated reader method
automatically generated writer method
automatically generated reader method
Previous: Generic functions, Up: Internals [Contents][Index]
common-lisp.
:class-name
This slot is read-only.
:error-text
This slot is read-only.
:failure-text
This slot is read-only.
:testcases
:testsuites
Previous: Definitions, Up: The cl-junit-xml Reference Manual [Contents][Index]
Jump to: | %
(
A C D E F G M N P T W |
---|
Jump to: | %
(
A C D E F G M N P T W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | C D E F N P S T |
---|
Jump to: | C D E F N P S T |
---|
Jump to: | C F J P S |
---|
Jump to: | C F J P S |
---|