Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/Test/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2011-03-11 19:44:59 +0000
committerPhil Nash2011-03-11 19:44:59 +0000
commit13bfe477c7d4d73a8988357f7a492c8c4491ab1b (patch)
tree1ee235f07e5dadd9aae58c95fb6350263a176610 /Test/TestMain.cpp
parent2e444861c9a33a28d1776daaeae5019c1d6ddfa0 (diff)
downloadcatch3-13bfe477c7d4d73a8988357f7a492c8c4491ab1b.tar.gz
Improvements to self test to give finer grained feedback
Diffstat (limited to 'Test/TestMain.cpp')
-rw-r--r--Test/TestMain.cpp51
1 files changed, 40 insertions, 11 deletions
diff --git a/Test/TestMain.cpp b/Test/TestMain.cpp
index 7ddcc23c..cb6d327f 100644
--- a/Test/TestMain.cpp
+++ b/Test/TestMain.cpp
@@ -11,22 +11,51 @@
*/
#include "../catch_with_main.hpp"
-
#include "../internal/catch_self_test.hpp"
TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" )
{
- Catch::EmbeddedRunner runner;
-
- runner.runMatching( "./succeeding/*" );
- INFO( runner.getOutput() );
- CHECK( runner.getSuccessCount() == 213 );
- CHECK( runner.getFailureCount() == 0 );
+ using namespace Catch;
+
+ ///////////////////////////////////////////////////////////////////////////
+ SECTION( "selftest/expected result",
+ "Tests do what they claim" )
+ {
+ SECTION( "selftest/expected result/failing tests",
+ "Tests in the 'failing' branch fail" )
+ {
+ MetaTestRunner::runMatching( "./failing/*", MetaTestRunner::Expected::ToFail );
+ }
+
+ SECTION( "selftest/expected result/succeeding tests",
+ "Tests in the 'succeeding' branch succeed" )
+ {
+ MetaTestRunner::runMatching( "./succeeding/*", MetaTestRunner::Expected::ToSucceed );
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ SECTION( "selftest/test counts",
+ "Number of test cases that run is fixed" )
+ {
+ EmbeddedRunner runner;
+
+ SECTION( "selftest/test counts/succeeding tests",
+ "Number of 'succeeding' tests is fixed" )
+ {
+ runner.runMatching( "./succeeding/*" );
+ CHECK( runner.getSuccessCount() == 213 );
+ CHECK( runner.getFailureCount() == 0 );
+ }
- runner.runMatching( "./failing/*" );
- INFO( runner.getOutput() );
- CHECK( runner.getSuccessCount() == 0 );
- CHECK( runner.getFailureCount() == 54 );
+ SECTION( "selftest/test counts/failing tests",
+ "Number of 'failing' tests is fixed" )
+ {
+ runner.runMatching( "./failing/*" );
+ CHECK( runner.getSuccessCount() == 0 );
+ CHECK( runner.getFailureCount() == 54 );
+ }
+ }
}
TEST_CASE( "meta/Misc/Sections", "looped tests" )