4 #include "../application/argumentparser.h" 26 operator bool()
const;
29 std::string workingCopyPathMode(
const std::string &name,
WorkingCopyMode mode)
const;
30 std::string workingCopyPath(
const std::string &name)
const;
31 int execApp(
const char *
const *args, std::string &output, std::string &errors,
bool suppressLogging =
false,
int timeout = -1)
const;
33 bool unitsSpecified()
const;
34 const std::vector<const char *> &units()
const;
44 std::string m_testFilesPathArgValue;
45 std::string m_testFilesPathEnvValue;
46 std::string m_workingDir;
57 inline TestApplication::operator bool()
const 67 return TestApplication::m_instance;
75 return m_unitsArg.isPresent();
84 return m_unitsArg.values();
123 inline CPP_UTILITIES_EXPORT int execApp(
const char *
const *args, std::string &output, std::string &errors)
152 template <
typename T> std::ostream &operator<< (std::ostream &out, const AsHexNumber<T> &value)
154 return out << std::hex <<
'0' <<
'x' << unsigned(value.value) << std::dec;
166 #ifndef TESTUTILS_ASSERT_EXEC 171 # define TESTUTILS_ASSERT_EXEC(args) \ 172 CPPUNIT_ASSERT_EQUAL(0, execApp(args, stdout, stderr)) 177 #endif // TESTUTILS_H bool unitsSpecified() const
Returns whether particular units have been specified.
The TestApplication class simplifies writing test applications that require opening test files...
AsHexNumber(const T &value)
Constructs a new instance; use asHexNumber() for convenience instead.
std::string testFilePath(const std::string &name) const
Returns the full path of the test file with the specified name.
Contains classes and functions utilizing creating of test applications.
bool operator==(const AsHexNumber< T > &lhs, const AsHexNumber< T > &rhs)
Provides operator == required by CPPUNIT_ASSERT_EQUAL.
The Argument class is a wrapper for command line argument information.
const std::vector< const char * > & units() const
Returns the specified test units.
AsHexNumber< T > asHexNumber(const T &value)
Wraps a value to be printed using the hex system in the error case when asserted with cppunit (or sim...
WorkingCopyMode
The WorkingCopyMode enum specifies additional options to influence behavior of TestApplication::worki...
The HelpArgument class prints help information for an argument parser when present (–help...
static const TestApplication * instance()
Returns the current TestApplication instance.
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.
The AsHexNumber class allows printing values asserted with cppunit (or similar test framework) using ...
CPP_UTILITIES_EXPORT std::string testFilePath(const std::string &name)
Convenience function which returns the full path of the test file with the specified name...
The ArgumentParser class provides a means for handling command line arguments.