diff options
author | Copybara-Service <copybara-worker@google.com> | 2022-03-15 13:55:30 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-03-15 13:55:30 (GMT) |
commit | 8a422b8398dd7e2b6b3e1fcbfbceb43ead2a5761 (patch) | |
tree | 8677cbf3a8bceafd7f6d4a48ef062cbc05e2a154 /docs | |
parent | ae5e06dd35c6137d335331b0815cf1f60fd7e3c5 (diff) | |
parent | 3c5320bf6f4632756a64dffb83b7837246e7f743 (diff) | |
download | googletest-8a422b8398dd7e2b6b3e1fcbfbceb43ead2a5761.zip googletest-8a422b8398dd7e2b6b3e1fcbfbceb43ead2a5761.tar.gz googletest-8a422b8398dd7e2b6b3e1fcbfbceb43ead2a5761.tar.bz2 |
Merge pull request #3774 from sobczyk:main
PiperOrigin-RevId: 434738675
Change-Id: I7c8de4004bac6b750674d19e3e79c0695a42652e
Diffstat (limited to 'docs')
-rw-r--r-- | docs/advanced.md | 21 | ||||
-rw-r--r-- | docs/reference/testing.md | 4 |
2 files changed, 19 insertions, 6 deletions
diff --git a/docs/advanced.md b/docs/advanced.md index f2f8854..7d81162 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -839,7 +839,7 @@ will output XML like this: ```xml ... - <testcase name="MinAndMaxWidgets" status="run" time="0.006" classname="WidgetUsageTest" MaximumWidgets="12" MinimumWidgets="9" /> + <testcase name="MinAndMaxWidgets" file="test.cpp" line="1" status="run" time="0.006" classname="WidgetUsageTest" MaximumWidgets="12" MinimumWidgets="9" /> ... ``` @@ -2082,15 +2082,15 @@ could generate this report: <?xml version="1.0" encoding="UTF-8"?> <testsuites tests="3" failures="1" errors="0" time="0.035" timestamp="2011-10-31T18:52:42" name="AllTests"> <testsuite name="MathTest" tests="2" failures="1" errors="0" time="0.015"> - <testcase name="Addition" status="run" time="0.007" classname=""> + <testcase name="Addition" file="test.cpp" line="1" status="run" time="0.007" classname=""> <failure message="Value of: add(1, 1)
 Actual: 3
Expected: 2" type="">...</failure> <failure message="Value of: add(1, -1)
 Actual: 1
Expected: 0" type="">...</failure> </testcase> - <testcase name="Subtraction" status="run" time="0.005" classname=""> + <testcase name="Subtraction" file="test.cpp" line="2" status="run" time="0.005" classname=""> </testcase> </testsuite> <testsuite name="LogicTest" tests="1" failures="0" errors="0" time="0.005"> - <testcase name="NonContradiction" status="run" time="0.005" classname=""> + <testcase name="NonContradiction" file="test.cpp" line="3" status="run" time="0.005" classname=""> </testcase> </testsuite> </testsuites> @@ -2108,6 +2108,9 @@ Things to note: * The `timestamp` attribute records the local date and time of the test execution. +* The `file` and `line` attributes record the source file location, where the + test was defined. + * Each `<failure>` element corresponds to a single failed googletest assertion. @@ -2147,6 +2150,8 @@ The report format conforms to the following JSON Schema: "type": "object", "properties": { "name": { "type": "string" }, + "file": { "type": "string" }, + "line": { "type": "integer" }, "status": { "type": "string", "enum": ["RUN", "NOTRUN"] @@ -2224,6 +2229,8 @@ message TestCase { message TestInfo { string name = 1; + string file = 6; + int32 line = 7; enum Status { RUN = 0; NOTRUN = 1; @@ -2267,6 +2274,8 @@ could generate this report: "testsuite": [ { "name": "Addition", + "file": "test.cpp", + "line": 1, "status": "RUN", "time": "0.007s", "classname": "", @@ -2283,6 +2292,8 @@ could generate this report: }, { "name": "Subtraction", + "file": "test.cpp", + "line": 2, "status": "RUN", "time": "0.005s", "classname": "" @@ -2298,6 +2309,8 @@ could generate this report: "testsuite": [ { "name": "NonContradiction", + "file": "test.cpp", + "line": 3, "status": "RUN", "time": "0.005s", "classname": "" diff --git a/docs/reference/testing.md b/docs/reference/testing.md index 554d6c9..dc47942 100644 --- a/docs/reference/testing.md +++ b/docs/reference/testing.md @@ -518,8 +518,8 @@ Logs a property for the current test, test suite, or entire invocation of the test program. Only the last value for a given key is logged. The key must be a valid XML attribute name, and cannot conflict with the ones -already used by GoogleTest (`name`, `status`, `time`, `classname`, `type_param`, -and `value_param`). +already used by GoogleTest (`name`, `file`, `line`, `status`, `time`, +`classname`, `type_param`, and `value_param`). `RecordProperty` is `public static` so it can be called from utility functions that are not members of the test fixture. |