From 95ae50ad3dc8d78ddcb6d921d54a6fdeb60a8416 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 24 Aug 2012 19:01:35 +0100 Subject: [PATCH] Test for ~ and removed debug print --- include/internal/catch_commandline.hpp | 1 - projects/SelfTest/TestMain.cpp | 9 +++++++++ single_include/catch.hpp | 3 +-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 2c4353ad..89a4b356 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -131,7 +131,6 @@ namespace Catch { } TestCaseFilters filters( groupName ); for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { - std::cout << "[" << cmd[i] << "]" << std::endl; if( startsWith( cmd[i], "exclude:" ) ) filters.addFilter( TestCaseFilter( cmd[i].substr( 8 ), IfFilterMatches::ExcludeTests ) ); else if( startsWith( cmd[i], "~" ) ) diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 8760646a..ad1f4842 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -137,6 +137,15 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) { REQUIRE( config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) ); } + SECTION( "--test/exclude:2", "Specify one test case exclusion using --test ~" ) { + const char* argv[] = { "test", "--test", "~test1" }; + CHECK_NOTHROW( parseIntoConfig( argv, config ) ); + + REQUIRE( config.filters.size() == 1 ); + REQUIRE( config.filters[0].shouldInclude( makeTestCase( "test1" ) ) == false ); + REQUIRE( config.filters[0].shouldInclude( makeTestCase( "alwaysIncluded" ) ) ); + } + SECTION( "-t/2", "Specify two test cases using -t" ) { const char* argv[] = { "test", "-t", "test1", "test2" }; CHECK_NOTHROW( parseIntoConfig( argv, config ) ); diff --git a/single_include/catch.hpp b/single_include/catch.hpp index f08c237c..776178d7 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,5 +1,5 @@ /* - * Generated: 2012-08-24 18:57:26.838444 + * Generated: 2012-08-24 19:01:02.483106 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -2594,7 +2594,6 @@ namespace Catch { } TestCaseFilters filters( groupName ); for( std::size_t i = 0; i < cmd.argsCount(); ++i ) { - std::cout << "[" << cmd[i] << "]" << std::endl; if( startsWith( cmd[i], "exclude:" ) ) filters.addFilter( TestCaseFilter( cmd[i].substr( 8 ), IfFilterMatches::ExcludeTests ) ); else if( startsWith( cmd[i], "~" ) )