Sha256: 8ee124bc6c3b5cf66e43397f4e5783ef9da0ddad935ecd58e3e07301cb9d2aed

Contents?: true

Size: 1.81 KB

Versions: 1

Compression:

Stored size: 1.81 KB

Contents

/*
 *  Created by Phil on 14/8/2012.
 *  Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
 *
 *  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)
 */
#ifndef TWOBLUECUBES_CATCH_TEST_SPEC_H_INCLUDED
#define TWOBLUECUBES_CATCH_TEST_SPEC_H_INCLUDED

#include "catch_tags.h"

#include <string>
#include <vector>

namespace Catch {

    class TestCase;

    struct IfFilterMatches{ enum DoWhat {
        AutoDetectBehaviour,
        IncludeTests,
        ExcludeTests
    }; };

    class TestCaseFilter {
        enum WildcardPosition {
            NoWildcard = 0,
            WildcardAtStart = 1,
            WildcardAtEnd = 2,
            WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
        };

    public:
        TestCaseFilter( std::string const& testSpec, IfFilterMatches::DoWhat matchBehaviour = IfFilterMatches::AutoDetectBehaviour );

        IfFilterMatches::DoWhat getFilterType() const;
        bool shouldInclude( TestCase const& testCase ) const;

    private:
        bool isMatch( TestCase const& testCase ) const;

        std::string m_stringToMatch;
        IfFilterMatches::DoWhat m_filterType;
        WildcardPosition m_wildcardPosition;
    };

    class TestCaseFilters {
    public:
        TestCaseFilters( std::string const& name );
        std::string getName() const;
        void addFilter( TestCaseFilter const& filter );
        void addTags( std::string const& tagPattern );
        bool shouldInclude( TestCase const& testCase ) const;

    private:
        std::vector<TagExpression> m_tagExpressions;
        std::vector<TestCaseFilter> m_inclusionFilters;
        std::vector<TestCaseFilter> m_exclusionFilters;
        std::string m_name;
    };

}

#endif // TWOBLUECUBES_CATCH_TEST_SPEC_H_INCLUDED

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redsnow-0.3.2 ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_spec.h