OSDN Git Service

change comments
[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  * @see CCUnitTestCase
47  */
48 typedef struct CCUnitTestSuite
49 {
50   CCUnitTest test;                  /**< super class */
51   const char* name;                 /**< test suite name */
52   CCUnitList tests;                 /**< added test case/suite list */
53 } CCUnitTestSuite;
54
55 /**
56  * Constructs an empty TestSuite.
57  * @param name test suite name.
58  * @return new test suite.
59  */
60 extern inline CCUnitTestSuite* ccunit_newTestSuite(const char* name);
61
62 /**
63  * Adds a test to the suite.
64  * @param suite test suite.
65  * @param test test to add.
66  */
67 extern inline void ccunit_addTest (CCUnitTestSuite* suite, CCUnitTest* test);
68
69 /**
70  * Adds a test suite to the suite.
71  * @param suite test suite.
72  * @param testSuite test to add.
73  */
74 extern inline void ccunit_addTestSuite (CCUnitTestSuite* suite,
75                                         CCUnitTestSuite* testSuite);
76
77 /**
78  * Adds a test case to the suite.
79  * @param suite test suite.
80  * @param testCase test to add.
81  */
82 extern inline void ccunit_addTestCase (CCUnitTestSuite* suite,
83                                        CCUnitTestCase* testCase);
84
85 /**
86  * Create a test suite from test source file.
87  * @param name test suite name.
88  * @return new test suite.
89  */
90 extern CCUnitTestSuite* ccunit_suite (const char* name);
91
92 #endif