38#define G_AT "GTestSuites::at(int&)"
39#define G_SET "GTestSuites::set(int&, GTestSuite&)"
40#define G_INSERT "GTestSuite* GTestSuites::insert(int&, GTestSuite&)"
41#define G_REMOVE "GTestSuites::remove(int&)"
133 if (
this != &suites) {
196 #if defined(G_RANGE_CHECK)
197 if (index < 0 || index >=
size()) {
218 #if defined(G_RANGE_CHECK)
219 if (index < 0 || index >=
size()) {
245 #if defined(G_RANGE_CHECK)
246 if (index < 0 || index >=
size()) {
303 #if defined(G_RANGE_CHECK)
310 if (index < 0 || index >=
size()) {
340 #if defined(G_RANGE_CHECK)
341 if (index < 0 || index >=
size()) {
369 int num = suites.
size();
375 for (
int i = 0; i < num; ++i) {
450 std::string text =
"* " +
name() +
" *";
454 std::cout << std::endl;
455 std::cout << frame << std::endl;
456 std::cout << text << std::endl;
457 std::cout << frame << std::endl;
512 result.append(
"=== GTestSuites ===");
526 for (
int i = 0; i <
size(); ++i) {
528 result.append((*
this)[i]->print(chatter));
550 m_name =
"Unnamed Test Suites";
633 element_testsuite->
attribute(
"hostname",
"");
636 element_testsuite->
attribute(
"package",
"");
637 element_testsuite->
attribute(
"skipped",
"");
643 for (
int j = 0; j < testsuite->
size(); ++j) {
669 element_testcase_problem->
name(
"error");
672 element_testcase_problem->
name(
"failure");
Test case class interface definition.
Test suite container class interface definition.
XML class interface definition.
void buffer_size(const int &size)
Set the buffer size.
void close(void)
Close log file.
void clear(void)
Clear object.
void cout(const bool &flag)
Set standard output stream (cout) flag.
const double & duration(void) const
Return test case duration.
const bool & has_passed(void) const
Return whether the test passed.
const ErrorKind & kind(void) const
Return kind of test case.
const std::string & name(void) const
Return test case name.
const std::string & type(void) const
Return test case type.
const std::string & message(void) const
Return test case message.
Abstract test suite class for unit testing on GammaLib fixtures.
const int & failures(void) const
Return the number of failures.
int size(void) const
Return number of tests in test suite.
const int & errors(void) const
Return the number of errors.
const time_t & timestamp(void) const
Return the timestamp.
virtual GTestSuite * clone(void) const =0
Clones object.
const std::string & name(void) const
Return test suite name.
double duration(void) const
Return the total duration of all tests.
Test suite container class.
void init_members(void)
Initialise class members.
void reserve(const int &num)
Reserves space for test suites in container.
void extend(const GTestSuites &suites)
Append test suite container.
bool run(void)
Run all tests.
int size(void) const
Return number of test suites in container.
GTestSuites & operator=(const GTestSuites &suites)
Assignment operator.
GTestSuite * append(const GTestSuite &suite)
Append test suite to container.
void copy_members(const GTestSuites &suites)
Copy class members.
GTestSuite * at(const int &index)
Returns pointer to test suite.
time_t m_timestamp
Timestamp.
GTestSuites(void)
Void constructor.
GTestSuite * set(const int &index, const GTestSuite &suite)
Set test suite in container.
void save(const GFilename &filename) const
Save test report into XML file.
void remove(const int &index)
Remove test suite from container.
virtual ~GTestSuites(void)
Destructor.
const std::string & name(void) const
Return test suite container name.
bool is_empty(void) const
Signals if there are no test suites in the container.
int failures(void) const
Return the total number of failures in all test suites.
GTestSuite * insert(const int &index, const GTestSuite &suite)
Insert test suite into container.
void write(GXml &xml) const
Write Test Suites into XML document.
std::string print(const GChatter &chatter=NORMAL) const
Print test suites information.
int tests(void) const
Return the total number of tests they are in all test suites.
void clear(void)
Clear test suites.
std::vector< GTestSuite * > m_testsuites
Vector of test suites.
GTestSuites * clone(void) const
Clone test suites.
int errors(void) const
Return the total number of errors in all test suites.
void free_members(void)
Delete class members.
std::string m_name
Name of container.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
const std::string & name(void) const
Return XML element name.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
void save(const GFilename &filename) const
Save XML document into file.
GXmlNode * append(const GXmlNode &node)
Append child node to XML document root.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
std::string fill(const std::string &s, const int &n)
Fill string with n strings of same type.