OSDN Git Service

(no commit message)
[ccunit/ccunit.git] / src / ccunit / CCUnitMakeSuite.h
1 /*
2  * $Id$
3  */
4 /* Copyright (C) 2003 TSUTSUMI Kikuo.
5    This file is part of the CCUnit Library.
6
7    The CCUnit Library is free software; you can redistribute it and/or
8    modify it under the terms of the GNU Lesser General Public License
9    as published by the Free Software Foundation; either version 2.1 of
10    the License, or (at your option) any later version.
11
12    The CCUnit Library is distributed in the hope that it will be
13    useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14    of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU Lesser General Public License for more details.
16
17    You should have received a copy of the GNU Lesser General Public
18    License along with the CCUnit Library; see the file COPYING.LESSER.
19    If not, write to the Free Software Foundation, Inc., 59 Temple
20    Place - Suite 330, Boston, MA 02111-1307, USA.  
21 */
22 #ifndef CCUNITMAKESUITE_H
23 #define CCUNITMAKESUITE_H
24
25 #include <ccunit/CCUnitConfig.h>
26 #include <ccunit/CCUnitList.h>
27 #include <ccunit/CCUnitTest.h>
28
29 #include <stdio.h>
30
31 /**
32  * Test Def.
33  */
34 typedef struct CCUnitTestDef
35 {
36   CCUnitTestType_t type;
37   char* name;
38 } CCUnitTestDef;
39
40 /**
41  * Test Suite Def.
42  */
43 typedef struct CCUnitTestSuiteDef
44 {
45   CCUnitTestDef super;
46   CCUnitList testdefs;
47 } CCUnitTestSuiteDef;
48
49 /**
50  * Test Function Def
51  */
52 typedef struct CCUnitTestFuncDef
53 {
54   char* type;
55   char* name;
56   char* desc;
57 } CCUnitTestFuncDef;
58
59 /**
60  * Test Case Def.
61  */
62 typedef struct CCUnitTestCaseDef
63 {
64   CCUnitTestDef super;
65   CCUnitList testFuncs;
66   CCUnitTestFuncDef* setUp;
67   CCUnitTestFuncDef* tearDown;
68   char* desc;
69 } CCUnitTestCaseDef;
70
71 /**
72  * read test unit suite from specified stream.
73  *
74  * @param fname test unit source code file.
75  * @param suite [out] test suite to read.
76  */
77 extern void ccunit_readTestDef (const char* fname, CCUnitTestSuiteDef* suite);
78
79 /**
80  * output test suite add function.
81  *
82  * @param ofp output stream.
83  * @param name add function name.
84  * @param suite test suite to print.
85  */
86 extern void ccunit_writeTestAdd (FILE* ofp,
87                                  const char* name,
88                                  CCUnitTestSuiteDef* suite);
89
90 /**
91  * create new test suite def.
92  *
93  * @param name suite name.
94  * @return created testdef.
95  */
96 extern CCUnitTestSuiteDef* ccunit_newTestSuiteDef (const char* name);
97
98 /**
99  * delete test suite def.
100  *
101  * @param suite test suite def.
102  */
103 extern void ccunit_deleteTestSuiteDef (CCUnitTestSuiteDef* suite);
104
105 extern int ccunit_makeSuite (int ac, char** av);
106 extern int ccunit_va_makeSuite (const char* prg, ...);
107
108 #endif