catch2/Test/TestMain.cpp

41 lines
1.0 KiB
C++
Raw Normal View History

2010-11-10 00:24:00 +01:00
/*
* main.cpp
* Catch - Test
*
* Created by Phil on 22/10/2010.
* Copyright 2010 Two Blue Cubes Ltd
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "../catch_with_main.hpp"
2010-11-10 00:24:00 +01:00
#include "../internal/catch_self_test.hpp"
TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" )
2010-11-10 00:24:00 +01:00
{
Catch::EmbeddedRunner runner;
runner.runMatching( "./succeeding/*" );
INFO( runner.getOutput() );
CHECK( runner.getSuccessCount() == 199 );
CHECK( runner.getFailureCount() == 0 );
runner.runMatching( "./failing/*" );
INFO( runner.getOutput() );
CHECK( runner.getSuccessCount() == 0 );
CHECK( runner.getFailureCount() == 53 );
2010-11-10 00:24:00 +01:00
}
TEST_CASE( "meta/Misc/Sections", "looped tests" )
{
Catch::EmbeddedRunner runner;
2011-02-21 19:50:35 +01:00
runner.runMatching( "./mixed/Misc/Sections/nested2" );
CHECK( runner.getSuccessCount() == 2 );
CHECK( runner.getFailureCount() == 1 );
}