Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
* JUnit Support -> JUnit XML Support
* Combine two sentences in check.texi
* xml->XML
* Add a line in the environment appendix
* Update the xml_format source code header comment
* Add a comment to xml_format
  • Loading branch information
Trever Shick committed Oct 30, 2021
1 parent ee51d1c commit 2e7563c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 6 additions & 5 deletions doc/check.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2052,12 +2052,11 @@ If both plain text and XML log files are specified, by any of above methods,
then check will log to both files. In other words logging in plain text and XML
format simultaneously is supported.

JUnit Support is also available. It is enabled by a call to
@code{srunner_set_xml_format(CK_XML_FORMAT_JUNIT)} before the tests are run.
It can also be enabled by environment variable as well. It is enabled by setting the
@code{CK_XML_FORMAT_NAME} environment variable to @code{junit}.
JUnit XML Support is also available. It is enabled by a call to
@code{srunner_set_xml_format(CK_XML_FORMAT_JUNIT)} before the tests are run.
It can also be enabled by setting the environment variable @code{CK_XML_FORMAT_NAME} to @code{junit}.

Here is an example of the JUnit xml format:
Here is an example of the JUnit XML format:
@example
@verbatim
<?xml version="1.0" encoding="UTF-8"?>
Expand Down Expand Up @@ -2364,6 +2363,8 @@ CK_LOG_FILE_NAME: Filename to write logs to. See section @ref{Test Logging}.
CK_XML_LOG_FILE_NAME: Filename to write XML log to. See section @ref{XML Logging}.
CK_XML_FORMAT_NAME: Name of the XML format to use. ``junit'' will output in JUnit XML format, all other values will yield the default XML format. @ref{XML Logging}.
CK_TAP_LOG_FILE_NAME: Filename to write TAP (Test Anything Protocol) output to. See section @ref{TAP Logging}.
CK_MAX_MSG_SIZE: Maximal assertion message size.
Expand Down
8 changes: 6 additions & 2 deletions src/check.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2285,11 +2285,15 @@ enum xml_format {
* Returns the XML format used if XML is to be logged.
*
* This value can be explicitly set via `srunner_set_xml_format` or can
* be set via the CK_XML_FORMAT_NAME environment variable.
* be set via the CK_XML_FORMAT_NAME environment variable.
*
* This setting does not conflict with the other log output types;
* all logging types can occur concurrently if configured.
* @return CK_XML_FORMAT_DEFAULT unless the format is explicitly set via
* `srunner_set_xml_format(sr, CK_XML_FORMAT_JUNIT)` or
* `getenv("CK_XML_FORMAT_NAME")` returns "unit"
* `getenv("CK_XML_FORMAT_NAME")` is set to a known value.
* Any value set explicitly via `srunner_set_xml_format` will take
* precedence over the environment variable.
*
* @param sr suite runner to check
*
Expand Down
2 changes: 1 addition & 1 deletion src/check_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct SRunner
List *resultlst; /* List of unit test results */
const char *log_fname; /* name of log file */
const char *xml_fname; /* name of xml output file */
enum xml_format xml_format;
enum xml_format xml_format; /* the xml format to use */
const char *tap_fname; /* name of tap output file */
List *loglst; /* list of Log objects */
enum fork_status fstat; /* controls if suites are forked or not
Expand Down

0 comments on commit 2e7563c

Please sign in to comment.