OSDN Git Service

add doxycomment
[ccunit/ccunit.git] / src / ccunit / CCUnitTestSuite.h
1 /* -*- mode: C; -*- */
2 /* Copyright (C) 2003 TSUTSUMI Kikuo.
3    This file is part of the CCUnit Library.
4
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.
9
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.
14
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.  
19 */
20
21 /*
22  * $Id$
23  */
24 /**
25  * @file
26  * Test suite class.
27  */
28 #ifndef CCUNITTESTSUITE_H
29 #define CCUNITTESTSUITE_H
30
31 #include <ccunit/CCUnitConfig.h>
32 #include <ccunit/CCUnitList.h>
33 #include <ccunit/CCUnitTest.h>
34 #include <ccunit/CCUnitTestCase.h>
35
36 /**
37  * A <code>Composite</code> class of Tests.
38  * It runs a collection of test cases. Here is an example.
39  * <pre>
40  * CCUnitTestSuite* suite = ccunit_newTestSuite ();
41  * ccunit_addTestCase (suite, CREATE_TESTCASE_1 ());
42  * ccunit_addTestCase (suite, CREATE_TESTCASE_2 ());
43  * </pre>
44  *
45  * @see CCUnitTest
46  */
47 typedef struct CCUnitTestSuite
48 {
49   CCUnitTest test;                  /**< super class */
50   CCUnitList tests;                 /**< added test case/suite list */
51 } CCUnitTestSuite;
52
53 /**
54  * Constructs an empty TestSuite.
55  * @param name test suite name.
56  * @return new test suite.
57  */
58 extern inline CCUnitTestSuite* ccunit_newTestSuite(const char* name);
59
60 /**
61  * Delete test suite.
62  * @param suite test suite to delete.
63  */
64 extern inline void ccunit_deleteTestSuite (CCUnitTestSuite* suite);
65
66 /**
67  * Adds a test to the suite.
68  * @param suite test suite.
69  * @param test test to add.
70  */
71 extern inline void ccunit_addTest (CCUnitTestSuite* suite, CCUnitTest* test);
72
73 /**
74  * Adds a test suite to the suite.
75  * @param suite test suite.
76  * @param testSuite test to add.
77  */
78 extern inline void ccunit_addTestSuite (CCUnitTestSuite* suite,
79                                         CCUnitTestSuite* testSuite);
80
81 /**
82  * Adds a test case to the suite.
83  * @param suite test suite.
84  * @param testCase test to add.
85  */
86 extern inline void ccunit_addTestCase (CCUnitTestSuite* suite,
87                                        CCUnitTestCase* testCase);
88
89 /**
90  * Create a test suite from test source file.
91  * @param name test suite name.
92  * @return new test suite.
93  */
94 extern CCUnitTestSuite* ccunit_suite (const char* name);
95
96 #endif