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");
void write(GXml &xml) const
Write Test Suites into XML document.
GTestSuites & operator=(const GTestSuites &suites)
Assignment operator.
Test suite container class.
Test suite container class interface definition.
const int & errors(void) const
Return the number of errors.
void save(const GFilename &filename) const
Save XML document into file.
std::vector< GTestSuite * > m_testsuites
Vector of test suites.
XML class interface definition.
void clear(void)
Clear test suites.
void free_members(void)
Delete class members.
void copy_members(const GTestSuites &suites)
Copy class members.
int failures(void) const
Return the total number of failures in all test suites.
void buffer_size(const int &size)
Set the buffer size.
double duration(void) const
Return the total duration of all tests.
const std::string & name(void) const
Return XML element name.
void reserve(const int &num)
Reserves space for test suites in container.
void cout(const bool &flag)
Set standard output stream (cout) flag.
const ErrorKind & kind(void) const
Return kind of test case.
const double & duration(void) const
Return test case duration.
time_t m_timestamp
Timestamp.
GTestSuites * clone(void) const
Clone test suites.
bool is_empty(void) const
Signals if there are no test suites in the container.
Test case class interface definition.
GTestSuite * at(const int &index)
Returns pointer to test suite.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
int size(void) const
Return number of test suites in container.
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 close(void)
Close log file.
virtual ~GTestSuites(void)
Destructor.
GTestSuite * append(const GTestSuite &suite)
Append test suite to container.
std::string print(const GChatter &chatter=NORMAL) const
Print test suites information.
Abstract test suite class for unit testing on GammaLib fixtures.
const std::string & name(void) const
Return test suite name.
void remove(const int &index)
Remove test suite from container.
int size(void) const
Return number of tests in test suite.
const std::string & message(void) const
Return test case message.
const time_t & timestamp(void) const
Return the timestamp.
GTestSuite * insert(const int &index, const GTestSuite &suite)
Insert test suite into container.
const std::string & type(void) const
Return test case type.
const std::string & name(void) const
Return test suite container name.
const bool & has_passed(void) const
Return whether the test passed.
const std::string & name(void) const
Return test case name.
const int & failures(void) const
Return the number of failures.
std::string m_name
Name of container.
void init_members(void)
Initialise class members.
GTestSuites(void)
Void constructor.
virtual GTestSuite * clone(void) const =0
Clones object.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string fill(const std::string &s, const int &n)
Fill string with n strings of same type.
bool run(void)
Run all tests.
int tests(void) const
Return the total number of tests they are in all test suites.
int errors(void) const
Return the total number of errors in all test suites.
void extend(const GTestSuites &suites)
Append test suite container.
GXmlNode * append(const GXmlNode &node)
Append child node to XML document root.
void clear(void)
Clear object.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.