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