summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestSuiteTest.h
blob: f39a6524befb55ea94e734da479faca60c301b67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef TESTSUITETEST_H
#define TESTSUITETEST_H

#include <cppunit/extensions/HelperMacros.h>


class TestSuiteTest : public CppUnit::TestCase
{
  CPPUNIT_TEST_SUITE( TestSuiteTest );
  CPPUNIT_TEST( testConstructor );
  CPPUNIT_TEST( testCountTestCasesWithNoTest );
  CPPUNIT_TEST( testCountTestCasesWithTwoTests );
  CPPUNIT_TEST( testCountTestCasesWithSubSuite );
  CPPUNIT_TEST( testRunWithOneTest );
  CPPUNIT_TEST( testRunWithOneTestAndSubSuite );
  CPPUNIT_TEST( testGetTests );
  CPPUNIT_TEST( testDeleteContents );
  CPPUNIT_TEST_SUITE_END();

public:
  TestSuiteTest();
  virtual ~TestSuiteTest();

  virtual void setUp();
  virtual void tearDown();

  void testConstructor();

  void testCountTestCasesWithNoTest();
  void testCountTestCasesWithTwoTests();
  void testCountTestCasesWithSubSuite();

  void testRunWithOneTest();
  void testRunWithOneTestAndSubSuite();

  void testGetTests();

  void testDeleteContents();

private:
  TestSuiteTest( const TestSuiteTest &copy );
  void operator =( const TestSuiteTest &copy );

  void checkResult( int failures,
                    int errors,
                    int testsRun );

private:
  CppUnit::TestSuite *m_suite;
  CppUnit::TestResult *m_result;
};



#endif  // TESTSUITETEST_H