diff options
| author | Martin Hořeňovský | 2017-08-10 11:34:26 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2017-08-10 11:34:26 +0200 |
| commit | aa42dd92d104e894e2b54d29a3defdf4b00eec21 (patch) | |
| tree | 4bdf430c746a2c98e6092705760d3f78c5421436 /projects | |
| parent | e658bacb04ef5c14c1dcb192c9e5c99cef390582 (diff) | |
| parent | 7e4038d8488596e850a11c8fe236b59bca605444 (diff) | |
| download | catch3-aa42dd92d104e894e2b54d29a3defdf4b00eec21.tar.gz | |
Merge branch 'master' into dev-modernize
Diffstat (limited to 'projects')
| -rw-r--r-- | projects/SelfTest/Baselines/console.std.approved.txt | 5 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/console.sw.approved.txt | 37 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/junit.sw.approved.txt | 12 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/xml.sw.approved.txt | 22 | ||||
| -rw-r--r-- | projects/SelfTest/MessageTests.cpp | 17 |
5 files changed, 87 insertions, 6 deletions
diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 9e41f7f5..c01923c1 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -671,6 +671,9 @@ with messages: A string sent directly to stdout A string sent directly to stderr +Write to std::cerr +Write to std::clog +Interleaved writes to error streams Message from section one Message from section two ------------------------------------------------------------------------------- @@ -1016,6 +1019,6 @@ with expansion: "{?}" == "1" =============================================================================== -test cases: 182 | 131 passed | 47 failed | 4 failed as expected +test cases: 183 | 132 passed | 47 failed | 4 failed as expected assertions: 896 | 779 passed | 96 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 971c0e32..6b64aee8 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -4177,6 +4177,39 @@ PASSED: with expansion: Approx( 1.23 ) != 1.24 +Write to std::cerr +------------------------------------------------------------------------------- +Standard error is reported and redirected + std::cerr +------------------------------------------------------------------------------- +MessageTests.cpp:<line number> +............................................................................... + + +No assertions in section 'std::cerr' + +Write to std::clog +------------------------------------------------------------------------------- +Standard error is reported and redirected + std::clog +------------------------------------------------------------------------------- +MessageTests.cpp:<line number> +............................................................................... + + +No assertions in section 'std::clog' + +Interleaved writes to error streams +------------------------------------------------------------------------------- +Standard error is reported and redirected + Interleaved writes to cerr and clog +------------------------------------------------------------------------------- +MessageTests.cpp:<line number> +............................................................................... + + +No assertions in section 'Interleaved writes to cerr and clog' + Message from section one ------------------------------------------------------------------------------- Standard output from all sections is reported @@ -7590,6 +7623,6 @@ MiscTests.cpp:<line number>: PASSED: =============================================================================== -test cases: 182 | 130 passed | 48 failed | 4 failed as expected -assertions: 898 | 779 passed | 98 failed | 21 failed as expected +test cases: 183 | 130 passed | 49 failed | 4 failed as expected +assertions: 901 | 779 passed | 101 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 58807c18..7a8d78e2 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesspanner> - <testsuite name="<exe-name>" errors="15" failures="84" tests="899" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="15" failures="87" tests="902" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}"> <error type="TEST_CASE"> @@ -486,6 +486,13 @@ A string sent directly to stderr </system-err> </testcase> <testcase classname="<exe-name>.global" name="Some simple comparisons between doubles" time="{duration}"/> + <testcase classname="<exe-name>.global" name="Standard error is reported and redirected/Interleaved writes to cerr and clog" time="{duration}"> + <system-err> +Write to std::cerr +Write to std::clog +Interleaved writes to error streams + </system-err> + </testcase> <testcase classname="<exe-name>.global" name="Standard output from all sections is reported/two" time="{duration}"> <system-out> Message from section one @@ -792,6 +799,9 @@ Message from section two </system-out> <system-err> A string sent directly to stderr +Write to std::cerr +Write to std::clog +Interleaved writes to error streams </system-err> </testsuite> </testsuites> diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index e70ad12e..188d734c 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -4817,6 +4817,24 @@ A string sent directly to stderr </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Standard error is reported and redirected" tags="[.][hide][messages]" filename="projects/<exe-name>/MessageTests.cpp" > + <Section name="std::cerr" filename="projects/<exe-name>/MessageTests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="std::clog" filename="projects/<exe-name>/MessageTests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="Interleaved writes to cerr and clog" filename="projects/<exe-name>/MessageTests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <OverallResult success="false"> + <StdErr> +Write to std::cerr +Write to std::clog +Interleaved writes to error streams + </StdErr> + </OverallResult> + </TestCase> <TestCase name="Standard output from all sections is reported" tags="[.][hide][messages]" filename="projects/<exe-name>/MessageTests.cpp" > <Section name="one" filename="projects/<exe-name>/MessageTests.cpp" > <OverallResults successes="0" failures="1" expectedFailures="0"/> @@ -8441,7 +8459,7 @@ spanner <OverallResult success="true"/> </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="779" failures="99" expectedFailures="21"/> + <OverallResults successes="779" failures="102" expectedFailures="21"/> </Group> - <OverallResults successes="779" failures="98" expectedFailures="21"/> + <OverallResults successes="779" failures="101" expectedFailures="21"/> </Catch> diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp index 21802ccd..0faa4d72 100644 --- a/projects/SelfTest/MessageTests.cpp +++ b/projects/SelfTest/MessageTests.cpp @@ -85,6 +85,23 @@ TEST_CASE( "Standard output from all sections is reported", "[messages][.]" ) { } } +TEST_CASE( "Standard error is reported and redirected", "[messages][.]" ) { + SECTION( "std::cerr" ) { + std::cerr << "Write to std::cerr" << std::endl; + } + SECTION( "std::clog" ) { + std::clog << "Write to std::clog" << std::endl; + } + SECTION( "Interleaved writes to cerr and clog" ) { + std::cerr << "Inter"; + std::clog << "leaved"; + std::cerr << ' '; + std::clog << "writes"; + std::cerr << " to error"; + std::clog << " streams\n"; + } +} + TEST_CASE( "SCOPED_INFO is reset for each loop", "[messages][failing][.]" ) { for( int i=0; i<100; i++ ) { |