aboutsummaryrefslogtreecommitdiff
path: root/test/validation/common/odp_cunit_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/validation/common/odp_cunit_common.h')
-rw-r--r--test/validation/common/odp_cunit_common.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h
index 3b4d9fb..bfb4cbf 100644
--- a/test/validation/common/odp_cunit_common.h
+++ b/test/validation/common/odp_cunit_common.h
@@ -43,21 +43,25 @@ typedef struct {
/** create thread fro start_routine function */
extern int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg);
extern int odp_cunit_thread_exit(pthrd_arg *);
+
/**
- * Global tests initialization.
- *
- * Initialize global resources needed by all testsuites. Default weak definition
- * do nothing. Test application can override it by defining a strong version.
- * The function is called by the common main() just after ODP global/local
- * initialization.
+ * Global tests initialization/termination.
*
- * @note: This function is a workaround for Crypto test and other applications
- * should try not to use it, because it will complicate migration to a
- * single test application in future. Normally each testsuite have to
- * prepare its environment in its own init function.
+ * Initialize global resources needed by the test executable. Default
+ * definition does ODP init / term (both global and local).
+ * Test executables can override it by calling one of the register function
+ * below (or by defining a strong version, but this is deprecated).
+ * The functions are called at the very beginning and very end of the test
+ * execution. Passing NULL to odp_cunit_register_global_init() and/or
+ * odp_cunit_register_global_term() is legal and will simply prevent the
+ * default (ODP init/term) to be done.
*/
extern int tests_global_init(void);
extern int tests_global_term(void);
+void odp_cunit_register_global_init(int (*func_init_ptr)(void));
+
+void odp_cunit_register_global_term(int (*func_term_ptr)(void));
+
#endif /* ODP_CUNICT_COMMON_H */