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
)
32 test_return_t
destroy(void*);
34 /* This is called a the beginning of any collection run. */
35 test_callback_fn
*collection_startup
;
37 test_return_t
startup(void*);
39 /* This is called a the end of any collection run. */
40 test_callback_fn
*collection_shutdown
;
42 test_return_t
shutdown(void* arg
)
44 if (collection_shutdown
)
46 return collection_shutdown(arg
);
53 These are run before/after the test. If implemented. Their execution is not controlled
57 /* This is called a the beginning of any run. */
58 test_callback_fn
*_startup
;
60 test_return_t
startup(void*);
63 This called on a test if the test requires a flush call (the bool is
66 test_callback_fn
*_flush
;
69 Run before and after the runnner is executed.
71 test_callback_fn
*pre_run
;
72 test_callback_fn
*post_run
;
81 test_return_t
flush(void* arg
, test_st
* run
);
83 void set_pre(test_callback_fn
*arg
)
88 void set_post(test_callback_fn
*arg
)
93 test_return_t
pre(void *arg
)
103 test_return_t
post(void *arg
)
107 return post_run(arg
);
116 If an error occurs during the test, this is called.
118 test_callback_error_fn
*_on_error
;
120 test_return_t
on_error(const enum test_return_t
, void *);
123 Runner represents the callers for the tests. If not implemented we will use
124 a set of default implementations.
133 Framework(const Framework
&);
136 Framework
& operator=(const Framework
&);