diff mbox

[PATCHv2,1/5] validation: own main in odp_timer.c

Message ID 1436364701-27420-2-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 744b8f5833db99e7d80a8602347c8e572d025b45
Headers show

Commit Message

Christophe Milard July 8, 2015, 2:11 p.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
---
 test/validation/Makefile.am |  2 ++
 test/validation/odp_timer.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 28ed20d..470350c 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -15,6 +15,8 @@  bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 ODP_CU_COMMON=common/odp_cunit_common.c
 
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
+odp_timer_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
+		  $(LIB)/libodp.la
 dist_odp_timer_SOURCES  = odp_timer.c
 
 ODP_MODULES = buffer \
diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index 88f5208..bff585e 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -527,7 +527,7 @@  static void test_odp_timer_all(void)
 	CU_PASS("ODP timer test");
 }
 
-CU_TestInfo test_odp_timer[] = {
+static CU_TestInfo test_odp_timer[] = {
 	{"test_timeout_pool_alloc",  test_timeout_pool_alloc},
 	{"test_timeout_pool_free",  test_timeout_pool_free},
 	{"test_odp_timer_cancel",  test_odp_timer_cancel},
@@ -535,7 +535,18 @@  CU_TestInfo test_odp_timer[] = {
 	CU_TEST_INFO_NULL,
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo timer_suites[] = {
 	{"Timer", NULL, NULL, NULL, NULL, test_odp_timer},
 	CU_SUITE_INFO_NULL,
 };
+
+static int timer_main(void)
+{
+	return odp_cunit_run(timer_suites);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return timer_main();
+}