/[escript]/trunk/tools/CppUnitTest/src/TestSuite.cpp
ViewVC logotype

Contents of /trunk/tools/CppUnitTest/src/TestSuite.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (show annotations)
Wed Nov 9 02:02:19 2005 UTC (17 years, 4 months ago) by jgs
File size: 1029 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1
2
3 #include "CppUnitTest/TestSuite.h"
4 #include "CppUnitTest/TestResult.h"
5
6 USING_NAMESPACE_CPPUNITTEST
7
8 // Deletes all tests in the suite.
9 void TestSuite::deleteContents ()
10 {
11 for (std::vector<Test *>::iterator it = m_tests.begin ();
12 it != m_tests.end ();
13 ++it)
14 delete *it;
15
16 }
17
18
19 // Runs the tests and collects their result in a TestResult.
20 void TestSuite::run (TestResult *result)
21 {
22 for (std::vector<Test *>::iterator it = m_tests.begin ();
23 it != m_tests.end ();
24 ++it) {
25 if (result->shouldStop ())
26 break;
27
28 Test *test = *it;
29 test->setArgs(getArgs());
30 test->run (result);
31 if(test->hasFailure()) {
32 setFailure();
33 }
34 }
35
36 }
37
38
39 // Counts the number of test cases that will be run by this test.
40 int TestSuite::countTestCases ()
41 {
42 int count = 0;
43
44 for (std::vector<Test *>::iterator it = m_tests.begin ();
45 it != m_tests.end ();
46 ++it)
47 count += (*it)->countTestCases ();
48
49 return count;
50
51 }
52
53

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26