2010-11-09 18:24:00 -05: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)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-18 14:52:19 -05:00
|
|
|
#include "../catch_with_main.hpp"
|
2010-11-09 18:24:00 -05:00
|
|
|
|
2011-01-19 03:52:25 -05:00
|
|
|
#include "../internal/catch_self_test.hpp"
|
|
|
|
|
2011-01-14 03:38:46 -05:00
|
|
|
TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" )
|
2010-11-09 18:24:00 -05:00
|
|
|
{
|
2011-02-21 13:48:00 -05:00
|
|
|
Catch::EmbeddedRunner runner;
|
2011-01-14 03:38:46 -05:00
|
|
|
|
2011-01-14 11:21:11 -05:00
|
|
|
runner.runMatching( "./succeeding/*" );
|
2011-02-09 04:08:10 -05:00
|
|
|
INFO( runner.getOutput() );
|
2011-03-10 09:09:32 -05:00
|
|
|
CHECK( runner.getSuccessCount() == 213 );
|
2011-02-09 04:08:10 -05:00
|
|
|
CHECK( runner.getFailureCount() == 0 );
|
2010-11-29 14:40:44 -05:00
|
|
|
|
2011-01-18 04:20:06 -05:00
|
|
|
runner.runMatching( "./failing/*" );
|
2011-02-16 14:02:09 -05:00
|
|
|
INFO( runner.getOutput() );
|
2011-02-09 04:08:10 -05:00
|
|
|
CHECK( runner.getSuccessCount() == 0 );
|
2011-03-09 14:45:05 -05:00
|
|
|
CHECK( runner.getFailureCount() == 54 );
|
2010-11-09 18:24:00 -05:00
|
|
|
}
|
2011-02-21 13:48:00 -05:00
|
|
|
|
|
|
|
TEST_CASE( "meta/Misc/Sections", "looped tests" )
|
|
|
|
{
|
|
|
|
Catch::EmbeddedRunner runner;
|
|
|
|
|
2011-02-21 13:50:35 -05:00
|
|
|
runner.runMatching( "./mixed/Misc/Sections/nested2" );
|
2011-02-28 03:18:52 -05:00
|
|
|
CHECK( runner.getSuccessCount() == 2 );
|
|
|
|
CHECK( runner.getFailureCount() == 1 );
|
2011-02-21 13:48:00 -05:00
|
|
|
|
|
|
|
}
|