Skip to content

Commit 2e7563c

Browse files
author
Trever Shick
committed
Update documentation
* 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
1 parent ee51d1c commit 2e7563c

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

doc/check.texi

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,12 +2052,11 @@ If both plain text and XML log files are specified, by any of above methods,
20522052
then check will log to both files. In other words logging in plain text and XML
20532053
format simultaneously is supported.
20542054

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

2060-
Here is an example of the JUnit xml format:
2059+
Here is an example of the JUnit XML format:
20612060
@example
20622061
@verbatim
20632062
<?xml version="1.0" encoding="UTF-8"?>
@@ -2364,6 +2363,8 @@ CK_LOG_FILE_NAME: Filename to write logs to. See section @ref{Test Logging}.
23642363
23652364
CK_XML_LOG_FILE_NAME: Filename to write XML log to. See section @ref{XML Logging}.
23662365
2366+
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}.
2367+
23672368
CK_TAP_LOG_FILE_NAME: Filename to write TAP (Test Anything Protocol) output to. See section @ref{TAP Logging}.
23682369
23692370
CK_MAX_MSG_SIZE: Maximal assertion message size.

src/check.h.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,11 +2285,15 @@ enum xml_format {
22852285
* Returns the XML format used if XML is to be logged.
22862286
*
22872287
* This value can be explicitly set via `srunner_set_xml_format` or can
2288-
* be set via the CK_XML_FORMAT_NAME environment variable.
2288+
* be set via the CK_XML_FORMAT_NAME environment variable.
22892289
*
2290+
* This setting does not conflict with the other log output types;
2291+
* all logging types can occur concurrently if configured.
22902292
* @return CK_XML_FORMAT_DEFAULT unless the format is explicitly set via
22912293
* `srunner_set_xml_format(sr, CK_XML_FORMAT_JUNIT)` or
2292-
* `getenv("CK_XML_FORMAT_NAME")` returns "unit"
2294+
* `getenv("CK_XML_FORMAT_NAME")` is set to a known value.
2295+
* Any value set explicitly via `srunner_set_xml_format` will take
2296+
* precedence over the environment variable.
22932297
*
22942298
* @param sr suite runner to check
22952299
*

src/check_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ struct SRunner
122122
List *resultlst; /* List of unit test results */
123123
const char *log_fname; /* name of log file */
124124
const char *xml_fname; /* name of xml output file */
125-
enum xml_format xml_format;
125+
enum xml_format xml_format; /* the xml format to use */
126126
const char *tap_fname; /* name of tap output file */
127127
List *loglst; /* list of Log objects */
128128
enum fork_status fstat; /* controls if suites are forked or not

0 commit comments

Comments
 (0)