aboutsummaryrefslogtreecommitdiff
path: root/test/validation
diff options
context:
space:
mode:
authorChristophe Milard <christophe.milard@linaro.org>2015-07-09 11:25:31 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-07-10 11:28:54 +0300
commit40bee6bb8c308458696d56f647604128a57a6c3d (patch)
tree8b66e2e8cd6d47960f8bdf2e0008fbac2f0aa968 /test/validation
parenteea19e76fdbbcc462ca775fcf7da7e0134d31de4 (diff)
validation: remove WEAK def of global_test_init
Removal of the weak definitions of global_test_init and global_test_term. This removes the last shared symbols between tests and therefore gives the possibility to create a test "superlib" containing all tests of all modules, if so wished. Also, it forces the definition of these functions into each lib using them. Test executable init and term function are called: <Module>_init[_*] and <Module>_term[_*] Where the possible suffix (_*) identifies the test executable, if needed. These functions are part of their module test library (<Module>lib.a) and they are registered using: odp_cunit_register_global_init(), and odp_cunit_register_global_term(); Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test/validation')
-rw-r--r--test/validation/common/odp_cunit_common.c8
-rw-r--r--test/validation/common/odp_cunit_common.h6
-rw-r--r--test/validation/crypto/crypto.c6
-rw-r--r--test/validation/synchronizers/synchronizers.c3
4 files changed, 11 insertions, 12 deletions
diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
index 67938f225..56493ac69 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -15,6 +15,8 @@ static odph_linux_pthread_t thread_tbl[MAX_WORKERS];
* global init/term functions which may be registered
* defaults to functions performing odp init/term.
*/
+static int tests_global_init(void);
+static int tests_global_term(void);
static struct {
int (*global_init_ptr)(void);
int (*global_term_ptr)(void);
@@ -42,7 +44,7 @@ int odp_cunit_thread_exit(pthrd_arg *arg)
return 0;
}
-ODP_WEAK_SYMBOL int tests_global_init(void)
+static int tests_global_init(void)
{
if (0 != odp_init_global(NULL, NULL)) {
fprintf(stderr, "error: odp_init_global() failed.\n");
@@ -56,7 +58,7 @@ ODP_WEAK_SYMBOL int tests_global_init(void)
return 0;
}
-ODP_WEAK_SYMBOL int tests_global_term(void)
+static int tests_global_term(void)
{
if (0 != odp_term_local()) {
fprintf(stderr, "error: odp_term_local() failed.\n");
@@ -76,8 +78,6 @@ ODP_WEAK_SYMBOL int tests_global_term(void)
* If some of these functions are not registered, the defaults functions
* (tests_global_init() and tests_global_term()) defined above are used.
* One should use these register functions when defining these hooks.
- * (overloading the weak symbol above is obsolete and will be removed in
- * the future).
* Note that passing NULL as function pointer is valid and will simply
* prevent the default (odp init/term) to be done.
*/
diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h
index bfb4cbf6b..92a22a9db 100644
--- a/test/validation/common/odp_cunit_common.h
+++ b/test/validation/common/odp_cunit_common.h
@@ -50,16 +50,12 @@ extern int odp_cunit_thread_exit(pthrd_arg *);
* 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).
+ * below.
* 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));
diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c
index 899fb5168..5b06cdc09 100644
--- a/test/validation/crypto/crypto.c
+++ b/test/validation/crypto/crypto.c
@@ -23,7 +23,7 @@ static CU_SuiteInfo crypto_suites[] = {
CU_SUITE_INFO_NULL,
};
-int tests_global_init(void)
+static int crypto_init(void)
{
odp_pool_param_t params;
odp_pool_t pool;
@@ -60,7 +60,7 @@ int tests_global_init(void)
return 0;
}
-int tests_global_term(void)
+static int crypto_term(void)
{
odp_pool_t pool;
odp_queue_t out_queue;
@@ -96,5 +96,7 @@ int tests_global_term(void)
int crypto_main(void)
{
+ odp_cunit_register_global_init(crypto_init);
+ odp_cunit_register_global_term(crypto_term);
return odp_cunit_run(crypto_suites);
}
diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c
index 61c6026b1..fb12a05e2 100644
--- a/test/validation/synchronizers/synchronizers.c
+++ b/test/validation/synchronizers/synchronizers.c
@@ -1052,7 +1052,7 @@ static int synchronizers_suite_init(void)
return 0;
}
-int tests_global_init(void)
+static int synchronizers_init(void)
{
uint32_t core_count, max_threads;
int ret = 0;
@@ -1210,5 +1210,6 @@ static CU_SuiteInfo synchronizers_suites[] = {
int synchronizers_main(void)
{
+ odp_cunit_register_global_init(synchronizers_init);
return odp_cunit_run(synchronizers_suites);
}