8#ifndef META_OCEAN_TEST_TEST_SELECTOR_H
9#define META_OCEAN_TEST_TEST_SELECTOR_H
16#include <unordered_set>
55 using Patterns = std::unordered_set<std::string>;
64 explicit TestSelector(
const std::string& testFunctions = std::string());
77 explicit operator bool()
const;
83 inline bool runAll()
const;
100 static bool matches(
const std::string& pattern,
const std::string& testName);
108 bool shouldExecute_ =
true;
145template <
bool tActive>
148 if (selector.runAll())
150 messageObject <<
"Entire";
154 messageObject <<
"Partial";
157 return messageObject;
168template <
bool tActive>
169MessageObject<tActive>&
operator<<(MessageObject<tActive>&& messageObject,
const TestSelector& selector)
171 if (selector.runAll())
173 messageObject <<
"Entire";
177 messageObject <<
"Partial";
180 return messageObject;
Messenger object, one object for each message.
Definition Messenger.h:448
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
Patterns patterns_
Set of test patterns parsed from the input string.
Definition TestSelector.h:105
TestSelector shouldRun(const std::string &testName) const
Determines whether a test with the given name should be executed and returns a sub-selector for hiera...
bool runAll() const
Returns whether all tests should be executed.
Definition TestSelector.h:111
std::unordered_set< std::string > Patterns
Definition of an unordered set holding test patterns.
Definition TestSelector.h:55
TestSelector(Patterns &&patterns, bool shouldExecute)
Creates a sub-selector for hierarchical test filtering.
TestSelector(const std::string &testFunctions=std::string())
Creates a new test selector from a comma-separated list of test function names.
static bool matches(const std::string &pattern, const std::string &testName)
Checks if a pattern matches a test name.
std::ostream & operator<<(std::ostream &stream, const TestResult &testResult)
Writes a test result to a stream.
Definition TestResult.h:200
The namespace covering the entire Ocean framework.
Definition Accessor.h:15