diff mbox

[PATCHv3,04/20] validation: synchronizers: lib populated

Message ID 1438018732-2778-5-git-send-email-christophe.milard@linaro.org
State Accepted
Commit d92420aeb6e17796ea4678ee1e7ff2455aea907d
Headers show

Commit Message

Christophe Milard July 27, 2015, 5:38 p.m. UTC
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/validation/synchronizers/synchronizers.c | 44 +++++++++++++--------------
 test/validation/synchronizers/synchronizers.h | 35 +++++++++++++++++++++
 2 files changed, 57 insertions(+), 22 deletions(-)
diff mbox

Patch

diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c
index ed56c8f..6b354b6 100644
--- a/test/validation/synchronizers/synchronizers.c
+++ b/test/validation/synchronizers/synchronizers.c
@@ -920,7 +920,7 @@  static void test_atomic_validate(void)
 }
 
 /* Barrier tests */
-static void synchronizers_test_no_barrier_functional(void)
+void synchronizers_test_no_barrier_functional(void)
 {
 	pthrd_arg arg;
 
@@ -930,7 +930,7 @@  static void synchronizers_test_no_barrier_functional(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_barrier_functional(void)
+void synchronizers_test_barrier_functional(void)
 {
 	pthrd_arg arg;
 
@@ -940,14 +940,14 @@  static void synchronizers_test_barrier_functional(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_barrier[] = {
+CU_TestInfo synchronizers_suite_barrier[] = {
 	{"no_barrier_functional", synchronizers_test_no_barrier_functional},
 	{"barrier_functional", synchronizers_test_barrier_functional},
 	CU_TEST_INFO_NULL
 };
 
 /* Thread-unsafe tests */
-static void synchronizers_test_no_lock_functional(void)
+void synchronizers_test_no_lock_functional(void)
 {
 	pthrd_arg arg;
 
@@ -956,13 +956,13 @@  static void synchronizers_test_no_lock_functional(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_no_locking[] = {
+CU_TestInfo synchronizers_suite_no_locking[] = {
 	{"no_lock_functional", synchronizers_test_no_lock_functional},
 	CU_TEST_INFO_NULL
 };
 
 /* Spin lock tests */
-static void synchronizers_test_spinlock_api(void)
+void synchronizers_test_spinlock_api(void)
 {
 	pthrd_arg arg;
 
@@ -971,7 +971,7 @@  static void synchronizers_test_spinlock_api(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_spinlock_functional(void)
+void synchronizers_test_spinlock_functional(void)
 {
 	pthrd_arg arg;
 
@@ -981,14 +981,14 @@  static void synchronizers_test_spinlock_functional(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_spinlock[] = {
+CU_TestInfo synchronizers_suite_spinlock[] = {
 	{"spinlock_api", synchronizers_test_spinlock_api},
 	{"spinlock_functional", synchronizers_test_spinlock_functional},
 	CU_TEST_INFO_NULL
 };
 
 /* Ticket lock tests */
-static void synchronizers_test_ticketlock_api(void)
+void synchronizers_test_ticketlock_api(void)
 {
 	pthrd_arg arg;
 
@@ -997,7 +997,7 @@  static void synchronizers_test_ticketlock_api(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_ticketlock_functional(void)
+void synchronizers_test_ticketlock_functional(void)
 {
 	pthrd_arg arg;
 
@@ -1008,14 +1008,14 @@  static void synchronizers_test_ticketlock_functional(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_ticketlock[] = {
+CU_TestInfo synchronizers_suite_ticketlock[] = {
 	{"ticketlock_api", synchronizers_test_ticketlock_api},
 	{"ticketlock_functional", synchronizers_test_ticketlock_functional},
 	CU_TEST_INFO_NULL
 };
 
 /* RW lock tests */
-static void synchronizers_test_rwlock_api(void)
+void synchronizers_test_rwlock_api(void)
 {
 	pthrd_arg arg;
 
@@ -1024,7 +1024,7 @@  static void synchronizers_test_rwlock_api(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_rwlock_functional(void)
+void synchronizers_test_rwlock_functional(void)
 {
 	pthrd_arg arg;
 
@@ -1034,13 +1034,13 @@  static void synchronizers_test_rwlock_functional(void)
 	odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_rwlock[] = {
+CU_TestInfo synchronizers_suite_rwlock[] = {
 	{"rwlock_api", synchronizers_test_rwlock_api},
 	{"rwlock_functional", synchronizers_test_rwlock_functional},
 	CU_TEST_INFO_NULL
 };
 
-static int synchronizers_suite_init(void)
+int synchronizers_suite_init(void)
 {
 	uint32_t num_threads, idx;
 
@@ -1052,7 +1052,7 @@  static int synchronizers_suite_init(void)
 	return 0;
 }
 
-static int synchronizers_init(void)
+int synchronizers_init(void)
 {
 	uint32_t core_count, max_threads;
 	int ret = 0;
@@ -1164,27 +1164,27 @@  static void test_atomic_functional(void *func_ptr(void *))
 	test_atomic_validate();
 }
 
-static void synchronizers_test_atomic_inc_dec(void)
+void synchronizers_test_atomic_inc_dec(void)
 {
 	test_atomic_functional(test_atomic_inc_dec_thread);
 }
 
-static void synchronizers_test_atomic_add_sub(void)
+void synchronizers_test_atomic_add_sub(void)
 {
 	test_atomic_functional(test_atomic_add_sub_thread);
 }
 
-static void synchronizers_test_atomic_fetch_inc_dec(void)
+void synchronizers_test_atomic_fetch_inc_dec(void)
 {
 	test_atomic_functional(test_atomic_fetch_inc_dec_thread);
 }
 
-static void synchronizers_test_atomic_fetch_add_sub(void)
+void synchronizers_test_atomic_fetch_add_sub(void)
 {
 	test_atomic_functional(test_atomic_fetch_add_sub_thread);
 }
 
-static CU_TestInfo synchronizers_suite_atomic[] = {
+CU_TestInfo synchronizers_suite_atomic[] = {
 	{"atomic_inc_dec", synchronizers_test_atomic_inc_dec},
 	{"atomic_add_sub", synchronizers_test_atomic_add_sub},
 	{"atomic_fetch_inc_dec", synchronizers_test_atomic_fetch_inc_dec},
@@ -1192,7 +1192,7 @@  static CU_TestInfo synchronizers_suite_atomic[] = {
 	CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo synchronizers_suites[] = {
+CU_SuiteInfo synchronizers_suites[] = {
 	{"barrier", NULL,
 	 NULL, NULL, NULL, synchronizers_suite_barrier},
 	{"nolocking", synchronizers_suite_init,
diff --git a/test/validation/synchronizers/synchronizers.h b/test/validation/synchronizers/synchronizers.h
index 8a93187..45b90e9 100644
--- a/test/validation/synchronizers/synchronizers.h
+++ b/test/validation/synchronizers/synchronizers.h
@@ -7,6 +7,41 @@ 
 #ifndef _ODP_TEST_SYNCHRONIZERS_H_
 #define _ODP_TEST_SYNCHRONIZERS_H_
 
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void synchronizers_test_no_barrier_functional(void);
+void synchronizers_test_barrier_functional(void);
+void synchronizers_test_no_lock_functional(void);
+void synchronizers_test_spinlock_api(void);
+void synchronizers_test_spinlock_functional(void);
+void synchronizers_test_ticketlock_api(void);
+void synchronizers_test_ticketlock_functional(void);
+void synchronizers_test_rwlock_api(void);
+void synchronizers_test_rwlock_functional(void);
+void synchronizers_test_atomic_inc_dec(void);
+void synchronizers_test_atomic_add_sub(void);
+void synchronizers_test_atomic_fetch_inc_dec(void);
+void synchronizers_test_atomic_fetch_add_sub(void);
+
+/* test arrays: */
+extern CU_TestInfo synchronizers_suite_barrier[];
+extern CU_TestInfo synchronizers_suite_no_locking[];
+extern CU_TestInfo synchronizers_suite_spinlock[];
+extern CU_TestInfo synchronizers_suite_ticketlock[];
+extern CU_TestInfo synchronizers_suite_rwlock[];
+extern CU_TestInfo synchronizers_suite_atomic[];
+
+/* test array init/term functions: */
+int synchronizers_suite_init(void);
+
+/* test registry: */
+extern CU_SuiteInfo synchronizers_suites[];
+
+/* executable init/term functions: */
+int synchronizers_init(void);
+
+/* main test program: */
 int synchronizers_main(void);
 
 #endif