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 ());
47 typedef struct CCUnitTestSuite
49 CCUnitTest test; /**< super class */
50 CCUnitList tests; /**< added test case/suite list */
54 * Constructs an empty TestSuite.
55 * @param name test suite name.
56 * @return new test suite.
58 extern inline CCUnitTestSuite* ccunit_newTestSuite(const char* name);
62 * @param suite test suite to delete.
64 extern inline void ccunit_deleteTestSuite (CCUnitTestSuite* suite);
67 * Adds a test to the suite.
68 * @param suite test suite.
69 * @param test test to add.
71 extern inline void ccunit_addTest (CCUnitTestSuite* suite, CCUnitTest* test);
74 * Adds a test suite to the suite.
75 * @param suite test suite.
76 * @param testSuite test to add.
78 extern inline void ccunit_addTestSuite (CCUnitTestSuite* suite,
79 CCUnitTestSuite* testSuite);
82 * Adds a test case to the suite.
83 * @param suite test suite.
84 * @param testCase test to add.
86 extern inline void ccunit_addTestCase (CCUnitTestSuite* suite,
87 CCUnitTestCase* testCase);
90 * Create a test suite from test source file.
91 * @param name test suite name.
92 * @return new test suite.
94 extern CCUnitTestSuite* ccunit_suite (const char* name);