OSDN Git Service

(no commit message)
[ccunit/ccunit.git] / src / ccunit / CCUnitTestCase.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 /**
26  * @file
27  * Test case class.
28  */
29 #ifndef CCUNITTESTCASE_H
30 #define CCUNITTESTCASE_H
31
32 #include <ccunit/CCUnitConfig.h>
33 #include <ccunit/CCUnitList.h>
34 #include <ccunit/CCUnitTest.h>
35
36 typedef struct CCUnitTestFunc
37 {
38   CCUnitTest test;
39   void (*testFunc) ();
40   const char* desc;
41 } CCUnitTestFunc;
42
43 typedef struct CCUnitTestCase
44 {
45   CCUnitTest test;
46   CCUnitList testFuncs;
47   void (*setUp) ();
48   void (*tearDown) ();
49 } CCUnitTestCase;
50
51 extern CCUnitTestCase* ccunit_newTestCase (const char* name,
52                                            void (*setUp)(),
53                                            void (*tearDown)());
54
55 extern void ccunit_addTestFunc (CCUnitTestCase* testCase,
56                                 const char* name,
57                                 void(*testFunc)(),
58                                 const char* desc);
59
60 extern void ccunit_runTestCase (CCUnitTestCase* testCase, CCUnitTestFunc* func);
61
62 #endif