2 // MuleUnit: A minimalistic C++ Unit testing framework based on EasyUnit.
4 // Copyright (c) 2005-2011 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2004-2011 Barthelemy Dagenais ( barthelemy@prologique.com )
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include <wx/string.h>
36 typedef std::list
<Test
*> TestList
;
40 * A TestCase is a collection of unit tests (instance of Test) and is
41 * always specified by the first parameter of a Test declaration.
48 * Main TestCase constructor.
50 * @param name TestCase name
52 TestCase(const wxString
& name
);
57 * Add a Test to the Test list. This method is used by TestRegistry.
59 * @param test Test instance to add to the Test list.
61 void addTest(Test
*test
);
68 const TestList
& getTests() const;
71 * Execute all Tests in the Test list of this TestCase, returning false if there were failures.
76 * Get the Test list size (number of Tests in this TestCase).
78 * @return The Test list size
80 int getTestsCount() const;
83 * Get the total number of failures reported by all Tests.
85 * @return The total number of failures reported by all Tests. 0
86 * if no test were run or if no failures were reported.
88 int getFailuresCount() const;
91 * Get the total number of successes reported by all Tests.
93 * @return The total number of successes reported by all Tests. 0
94 * if no test were run or if no successes were reported.
96 int getSuccessesCount() const;
99 * Get the TestCase name. This name is specified by the first parameter
100 * of the Test declaration. For example, if a test was declared as
101 * TEST(TESTCASE1, TEST1), the TestCase name would be "TESTCASE1".
103 * @return The name of the TestCase
105 const wxString
& getName() const;
109 int m_successesCount
;
114 void runTests(Test
*test
);