diff mbox

[3/6] validation: own main in odp_system

Message ID 1435924179-30967-4-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 11f7798a5c38d38b374eed81d744c5d843d9cf80
Headers show

Commit Message

Christophe Milard July 3, 2015, 11:49 a.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/validation/Makefile.am     |  2 ++
 test/validation/system/system.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 6e4d227..cbd7f5d 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -19,6 +19,8 @@  ODP_CU_COMMON=common/odp_cunit_common.c
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_timer_SOURCES  = odp_timer.c
+odp_system_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
+		   $(LIB)/libodp.la
 odp_system_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/system
 dist_odp_system_SOURCES  = system/system.c
 
diff --git a/test/validation/system/system.c b/test/validation/system/system.c
index b462e8d..212dba9 100644
--- a/test/validation/system/system.c
+++ b/test/validation/system/system.c
@@ -82,7 +82,7 @@  static void test_odp_sys_cpu_hz(void)
 	CU_ASSERT(0 < hz);
 }
 
-CU_TestInfo test_odp_system[] = {
+static CU_TestInfo test_odp_system[] = {
 	{"odp version",  test_odp_version_numbers},
 	{"odp_cpu_count",  test_odp_cpu_count},
 	{"odp_sys_cache_line_size",  test_odp_sys_cache_line_size},
@@ -93,7 +93,18 @@  CU_TestInfo test_odp_system[] = {
 	CU_TEST_INFO_NULL,
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo system_suites[] = {
 	{"System Info", NULL, NULL, NULL, NULL, test_odp_system},
 	CU_SUITE_INFO_NULL,
 };
+
+static int system_main(void)
+{
+	return odp_cunit_run(system_suites);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return system_main();
+}