r14723: Keep statistics
[ira/wip.git] / source4 / torture / ui.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB torture UI functions
4
5    Copyright (C) Jelmer Vernooij 2006
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 struct torture_test;
23
24 enum torture_result { 
25         TORTURE_OK=0, 
26         TORTURE_FAIL=1, 
27         TORTURE_TODO=2, 
28         TORTURE_SKIP=3
29 };
30
31 struct torture_ui_ops
32 {
33         void (*comment) (struct torture_test *, const char *);
34         void (*test_start) (struct torture_test *);
35         void (*test_result) (struct torture_test *, enum torture_result);
36 };
37
38 struct torture_test
39 {
40         char *name;
41         char *description;
42
43         void *ui_data;
44
45         struct torture_context *context;
46 };
47
48 struct torture_context
49 {
50         const struct torture_ui_ops *ui_ops;
51         void *ui_data;
52
53         int skipped;
54         int todo;
55         int success;
56         int failed;
57 };