Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_config.cpp
Go to the documentation of this file.
1/*
2 * Created by Martin on 19/07/2017.
3 *
4 * Distributed under the Boost Software License, Version 1.0. (See accompanying
5 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 */
7
8#include "catch_config.hpp"
9#include "catch_enforce.h"
10#include "catch_stringref.h"
11
12namespace Catch {
13
15 : m_data( data ),
16 m_stream( openStream() )
17 {
19 if (!data.testsOrTags.empty()) {
20 m_hasTestFilters = true;
21 for( auto const& testOrTags : data.testsOrTags )
22 parser.parse( testOrTags );
23 }
24 m_testSpec = parser.testSpec();
25 }
26
27 std::string const& Config::getFilename() const {
28 return m_data.outputFilename ;
29 }
30
31 bool Config::listTests() const { return m_data.listTests; }
32 bool Config::listTestNamesOnly() const { return m_data.listTestNamesOnly; }
33 bool Config::listTags() const { return m_data.listTags; }
34 bool Config::listReporters() const { return m_data.listReporters; }
35
36 std::string Config::getProcessName() const { return m_data.processName; }
37 std::string const& Config::getReporterName() const { return m_data.reporterName; }
38
39 std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
40 std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
41
42 TestSpec const& Config::testSpec() const { return m_testSpec; }
43 bool Config::hasTestFilters() const { return m_hasTestFilters; }
44
45 bool Config::showHelp() const { return m_data.showHelp; }
46
47 // IConfig interface
48 bool Config::allowThrows() const { return !m_data.noThrow; }
49 std::ostream& Config::stream() const { return m_stream->stream(); }
50 std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
53 bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
56 unsigned int Config::rngSeed() const { return m_data.rngSeed; }
59 bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
60 int Config::abortAfter() const { return m_data.abortAfter; }
61 bool Config::showInvisibles() const { return m_data.showInvisibles; }
62 Verbosity Config::verbosity() const { return m_data.verbosity; }
63
64 IStream const* Config::openStream() {
65 return Catch::makeStream(m_data.outputFilename);
66 }
67
68} // end namespace Catch
std::vector< std::string > const & getTestsOrTags() const override
bool hasTestFilters() const override
std::string name() const override
std::vector< std::string > const & getSectionsToRun() const override
bool listTests() const
unsigned int rngSeed() const override
bool listReporters() const
bool warnAboutMissingAssertions() const override
int benchmarkResolutionMultiple() const override
bool showInvisibles() const override
UseColour::YesOrNo useColour() const override
std::string const & getFilename() const
ShowDurations::OrNot showDurations() const override
bool includeSuccessfulResults() const override
bool listTestNamesOnly() const
bool listTags() const
TestSpec const & testSpec() const override
Verbosity verbosity() const override
RunTests::InWhatOrder runOrder() const override
int abortAfter() const override
bool warnAboutNoTests() const override
std::string getProcessName() const
std::ostream & stream() const override
std::string const & getReporterName() const
bool allowThrows() const override
bool shouldDebugBreak() const override
Config()=default
bool showHelp() const
TestSpecParser & parse(std::string const &arg)
auto makeStream(StringRef const &filename) -> IStream const *
ShowDurations::OrNot showDurations
RunTests::InWhatOrder runOrder
std::string outputFilename
std::vector< std::string > sectionsToRun
std::string reporterName
std::vector< std::string > testsOrTags
UseColour::YesOrNo useColour
std::string processName
unsigned int rngSeed
WarnAbout::What warnings
static ITagAliasRegistry const & get()