diff --git a/docs/advanced.md b/docs/advanced.md index f2f8854b..42f2a09b 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -839,7 +839,7 @@ will output XML like this: ```xml ... - + ... ``` @@ -2082,15 +2082,15 @@ could generate this report: - + ... ... - + - + @@ -2108,6 +2108,8 @@ 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 `` element corresponds to a single failed googletest assertion. @@ -2147,6 +2149,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 +2228,8 @@ message TestCase { message TestInfo { string name = 1; + string file = 6; + int32 line = 7; enum Status { RUN = 0; NOTRUN = 1; @@ -2267,6 +2273,8 @@ could generate this report: "testsuite": [ { "name": "Addition", + "file": "test.cpp", + "line": 1, "status": "RUN", "time": "0.007s", "classname": "", @@ -2283,6 +2291,8 @@ could generate this report: }, { "name": "Subtraction", + "file": "test.cpp", + "line": 2, "status": "RUN", "time": "0.005s", "classname": "" @@ -2298,6 +2308,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 554d6c95..226fe499 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.