From 65e4111c31b4fd7138c14b65b73508dff12c0792 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 21 Feb 2011 18:48:00 +0000 Subject: [PATCH] Added more focussed meta test for sections and fixed bug in outstanding section detection --- Test/TestMain.cpp | 14 +++++++++++--- internal/catch_runner_impl.hpp | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Test/TestMain.cpp b/Test/TestMain.cpp index b3d29805..05c5f1c7 100644 --- a/Test/TestMain.cpp +++ b/Test/TestMain.cpp @@ -16,9 +16,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" ) { - using namespace Catch; - - EmbeddedRunner runner; + Catch::EmbeddedRunner runner; runner.runMatching( "./succeeding/*" ); INFO( runner.getOutput() ); @@ -30,3 +28,13 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" CHECK( runner.getSuccessCount() == 0 ); CHECK( runner.getFailureCount() == 53 ); } + +TEST_CASE( "meta/Misc/Sections", "looped tests" ) +{ + Catch::EmbeddedRunner runner; + + runner.runMatching( "./succeeding/Misc/Sections/nested2" ); + CHECK( runner.getSuccessCount() == 9 ); + CHECK( runner.getFailureCount() == 2 ); + +} diff --git a/internal/catch_runner_impl.hpp b/internal/catch_runner_impl.hpp index e34629ed..3ef5a25e 100644 --- a/internal/catch_runner_impl.hpp +++ b/internal/catch_runner_impl.hpp @@ -297,7 +297,7 @@ namespace Catch const { return m_rootSection.hasUntestedSections() || - m_runStatus != RanToCompletionWithSections; + m_runStatus == RanAtLeastOneSection; } private: