diff mbox

[1/5] validation: own main in odp_thread.c

Message ID 1435738773-31515-2-git-send-email-christophe.milard@linaro.org
State Accepted
Commit a3385d8655d7eca1b1628cda0c6bacb3319b5126
Headers show

Commit Message

Christophe Milard July 1, 2015, 8:19 a.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/validation/Makefile.am  |  2 ++
 test/validation/odp_thread.c | 15 +++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index a3efffe..52dc963 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -24,6 +24,8 @@  dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
 dist_odp_timer_SOURCES  = odp_timer.c
 dist_odp_cpumask_SOURCES = odp_cpumask.c
+odp_thread_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
+		   $(LIB)/libodp.la
 dist_odp_thread_SOURCES = odp_thread.c
 odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
 dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
diff --git a/test/validation/odp_thread.c b/test/validation/odp_thread.c
index 84db1e7..96d624c 100644
--- a/test/validation/odp_thread.c
+++ b/test/validation/odp_thread.c
@@ -28,14 +28,25 @@  static void test_odp_thread_count(void)
 	CU_PASS();
 }
 
-CU_TestInfo test_odp_thread[] = {
+static CU_TestInfo test_odp_thread[] = {
 	_CU_TEST_INFO(test_odp_cpu_id),
 	_CU_TEST_INFO(test_odp_thread_id),
 	_CU_TEST_INFO(test_odp_thread_count),
 	CU_TEST_INFO_NULL,
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo thread_suites[] = {
 	{"thread", NULL, NULL, NULL, NULL, test_odp_thread},
 	CU_SUITE_INFO_NULL,
 };
+
+static int thread_main(void)
+{
+	return odp_cunit_run(thread_suites);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return thread_main();
+}