CMake/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
Stefan Floeren 839a1010a3 GoogleTestAddTests: Fix output processing
The function gtest_discover_tests calls the passed test executable with
the parameter --gtest_list_tests and parses the output to find all
tests.

In case of value-parameterized tests ([1]), the test values are included
in the output. While test names are alphanumeric, the values can contain
arbitrary content.

First, the output is separated into lines with `foreach`. Included
semi-colons breaks this and need to get escaped.

Afterwards, the testname is passed on to the `add_command` helper. This
helper was converted into a macro in commit dac201442d (GoogleTest:
Optimize gtest_discover_tests, 2020-02-18). As a macro, its arguments
are re-evaluated. Therefore we need to escape `\`, `;` and to prevent
unwanted variable expansion `$`.

Fixes: #20661

[1] <https://github.com/google/googletest/blob/0eea2e9/googletest/docs/advanced.md#value-parameterized-tests>
2020-05-05 07:23:17 +00:00

32 lines
1.5 KiB
Plaintext

Test project .*
Start 12: TEST:basic\.case_foo!2
1/11 Test #12: TEST:basic\.case_foo!2 \.+ +Passed +[0-9.]+ sec
Start 13: TEST:basic\.case_bar!2
2/11 Test #13: TEST:basic\.case_bar!2 \.+ +Passed +[0-9.]+ sec
Start 14: TEST:basic\.disabled_case!2
3/11 Test #14: TEST:basic\.disabled_case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
Start 15: TEST:disabled\.case!2
4/11 Test #15: TEST:disabled\.case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
Start 16: TEST:typed/short\.case!2
5/11 Test #16: TEST:typed/short\.case!2 \.+ +Passed +[0-9.]+ sec
Start 17: TEST:typed/float\.case!2
6/11 Test #17: TEST:typed/float\.case!2 \.+ +Passed +[0-9.]+ sec
Start 18: TEST:value/test\.case/1!2
7/11 Test #18: TEST:value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec
Start 19: TEST:value/test\.case/"foo"!2
8/11 Test #19: TEST:value/test\.case/"foo"!2 \.+ +Passed +[0-9.]+ sec
Start 20: TEST:param/special\.case/"semicolon;"!2
9/11 Test #20: TEST:param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec
Start 21: TEST:param/special\.case/"backslash\\"!2
10/11 Test #21: TEST:param/special\.case/"backslash\\"!2 \.+ +Passed +[0-9.]+ sec
Start 22: TEST:param/special\.case/"\$\{var\}"!2
11/11 Test #22: TEST:param/special\.case/"\$\{var\}"!2 \.+ +Passed +[0-9.]+ sec
100% tests passed, 0 tests failed out of 9
Total Test time \(real\) = +[0-9.]+ sec
The following tests did not run:
.*14 - TEST:basic\.disabled_case!2 \(Disabled\)
.*15 - TEST:disabled\.case!2 \(Disabled\)