1 #ifndef ROSE_CommandLine_SelfTest_H
2 #define ROSE_CommandLine_SelfTest_H
6 #include <Sawyer/CommandLine.h>
7 #include <Sawyer/SharedObject.h>
8 #include <Sawyer/SharedPointer.h>
11 namespace CommandLine {
26 virtual std::string name()
const = 0;
31 virtual bool operator()() = 0;
38 ROSE_DLL_API
extern std::vector<SelfTest::Ptr>
selfTests;
47 template<
class SelfTest>
60 static Ptr instance() {
66 ASSERT_require(cmdline.
have(
"self-test"));
void insertSelfTest()
Convenient way to add a command-line self test.
size_t have(const std::string &switchKey) const
Returns the number of values for the specified key.
Base class for self tests.
ROSE_DLL_API void runSelfTestsAndExit()
Runs the self tests and then exits the program.
The result from parsing a command line.
Reference-counting intrusive smart pointer.
Main namespace for the ROSE library.
Base class for reference counted objects.
Base class for switch actions.
ROSE_DLL_API std::vector< SelfTest::Ptr > selfTests
Collection of self tests to be run by –self-tests switch.
Run self tests from the command-line, then exit.