1 /* uTest Copyright (C) 2011 Data Differential, http://datadifferential.com/
3 * Use and distribution licensed under the BSD license. See
4 * the COPYING file in the parent directory for full text.
10 Framework is the structure which is passed to the test implementation to be filled.
11 This must be implemented in order for the test framework to load the tests. We call
12 get_world() in order to fill this structure.
16 collection_st
*collections
;
18 /* These methods are called outside of any collection call. */
19 test_callback_create_fn
*_create
;
20 test_callback_fn
*_destroy
;
22 void* create(test_return_t
* arg
);
24 /* This is called a the beginning of any collection run. */
25 test_callback_fn
*collection_startup
;
27 test_return_t
startup(void*);
29 /* This is called a the end of any collection run. */
30 test_callback_fn
*collection_shutdown
;
32 test_return_t
shutdown(void* arg
)
34 if (collection_shutdown
)
36 return collection_shutdown(arg
);
43 These are run before/after the test. If implemented. Their execution is not controlled
47 /* This is called a the beginning of any run. */
48 test_callback_fn
*_startup
;
50 test_return_t
startup(void*);
53 This called on a test if the test requires a flush call (the bool is
56 test_callback_fn
*_flush
;
59 Run before and after the runnner is executed.
61 test_callback_fn
*pre_run
;
62 test_callback_fn
*post_run
;
71 test_return_t
flush(void* arg
, test_st
* run
);
73 void set_pre(test_callback_fn
*arg
)
78 void set_post(test_callback_fn
*arg
)
83 test_return_t
pre(void *arg
)
93 test_return_t
post(void *arg
)
106 If an error occurs during the test, this is called.
108 test_callback_error_fn
*_on_error
;
110 test_return_t
on_error(const enum test_return_t
, void *);
113 Runner represents the callers for the tests. If not implemented we will use
114 a set of default implementations.
120 virtual ~Framework();
122 Framework(const Framework
&);
125 Framework
& operator=(const Framework
&);