2 /* Copyright (C) 2003 TSUTSUMI Kikuo.
3 This file is part of the CCUnit Library.
5 The CCUnit Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License
7 as published by the Free Software Foundation; either version 2.1 of
8 the License, or (at your option) any later version.
10 The CCUnit Library is distributed in the hope that it will be
11 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the CCUnit Library; see the file COPYING.LESSER.
17 If not, write to the Free Software Foundation, Inc., 59 Temple
18 Place - Suite 330, Boston, MA 02111-1307, USA.
28 #ifndef CCUNITTESTSUITE_H
29 #define CCUNITTESTSUITE_H
31 #include <ccunit/CCUnitConfig.h>
32 #include <ccunit/CCUnitList.h>
33 #include <ccunit/CCUnitTest.h>
34 #include <ccunit/CCUnitTestCase.h>
37 * A <code>Composite</code> class of Tests.
38 * It runs a collection of test cases. Here is an example.
40 * CCUnitTestSuite* suite = ccunit_newTestSuite ();
41 * ccunit_addTestCase (suite, CREATE_TESTCASE_1 ());
42 * ccunit_addTestCase (suite, CREATE_TESTCASE_2 ());
48 typedef struct CCUnitTestSuite
50 CCUnitTest test; /**< super class */
51 const char* name; /**< test suite name */
52 CCUnitList tests; /**< added test case/suite list */
56 * Constructs an empty TestSuite.
57 * @param name test suite name.
58 * @return new test suite.
60 extern inline CCUnitTestSuite* ccunit_newTestSuite(const char* name);
63 * Adds a test to the suite.
64 * @param suite test suite.
65 * @param test test to add.
67 extern inline void ccunit_addTest (CCUnitTestSuite* suite, CCUnitTest* test);
70 * Adds a test suite to the suite.
71 * @param suite test suite.
72 * @param testSuite test to add.
74 extern inline void ccunit_addTestSuite (CCUnitTestSuite* suite,
75 CCUnitTestSuite* testSuite);
78 * Adds a test case to the suite.
79 * @param suite test suite.
80 * @param testCase test to add.
82 extern inline void ccunit_addTestCase (CCUnitTestSuite* suite,
83 CCUnitTestCase* testCase);
86 * Create a test suite from test source file.
87 * @param name test suite name.
88 * @return new test suite.
90 extern CCUnitTestSuite* ccunit_suite (const char* name);