diff mbox

[1/4] validation: own main in init

Message ID 1435164691-6714-2-git-send-email-christophe.milard@linaro.org
State Accepted
Commit e325d7edc69f09ddcfb1b7eb401b3a3938218783
Headers show

Commit Message

Christophe Milard June 24, 2015, 4:51 p.m. UTC
The 3 init test executables, odp_init.c, odp_init_abort.c, odp_init_log.c,
now provides their own main.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/validation/Makefile.am           |  7 +++++++
 test/validation/init/odp_init.c       | 15 +++++++++++++--
 test/validation/init/odp_init_abort.c | 15 +++++++++++++--
 test/validation/init/odp_init_log.c   | 15 +++++++++++++--
 4 files changed, 46 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 1db0e91..bccc886 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -30,8 +30,15 @@  ODP_CU_COMMON=common/odp_cunit_common.c
 odp_buffer_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/buffer
 dist_odp_buffer_SOURCES = odp_buffer.c
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
+odp_init_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
+		 $(LIB)/libodp.la
 dist_odp_init_SOURCES	= init/odp_init.c
+odp_init_abort_LDADD = \
+		 $(top_builddir)/test/validation/common/libcunit_common.a \
+		 $(LIB)/libodp.la
 dist_odp_init_abort_SOURCES = init/odp_init_abort.c
+odp_init_log_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
+		     $(LIB)/libodp.la
 dist_odp_init_log_SOURCES = init/odp_init_log.c
 dist_odp_queue_SOURCES	= odp_queue.c
 odp_random_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
diff --git a/test/validation/init/odp_init.c b/test/validation/init/odp_init.c
index 082e7c2..8a5b606 100644
--- a/test/validation/init/odp_init.c
+++ b/test/validation/init/odp_init.c
@@ -35,12 +35,23 @@  static void test_odp_init_global(void)
 	CU_ASSERT(status == 0);
 }
 
-CU_TestInfo test_odp_init[] = {
+static CU_TestInfo test_odp_init[] = {
 	{"test_odp_init_global",  test_odp_init_global},
 	CU_TEST_INFO_NULL,
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo init_suites_ok[] = {
 	{"Init", NULL, NULL, NULL, NULL, test_odp_init},
 	CU_SUITE_INFO_NULL,
 };
+
+static int init_main_ok(void)
+{
+	return odp_cunit_run(init_suites_ok);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return init_main_ok();
+}
diff --git a/test/validation/init/odp_init_abort.c b/test/validation/init/odp_init_abort.c
index c83c8d3..2304499 100644
--- a/test/validation/init/odp_init_abort.c
+++ b/test/validation/init/odp_init_abort.c
@@ -40,12 +40,12 @@  static void test_odp_init_global_replace_abort(void)
 	CU_ASSERT(status == 0);
 }
 
-CU_TestInfo test_odp_init[] = {
+static CU_TestInfo test_odp_init[] = {
 	{"replace abort",  test_odp_init_global_replace_abort},
 	CU_TEST_INFO_NULL,
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo init_suites_abort[] = {
 	{"Init", NULL, NULL, NULL, NULL, test_odp_init},
 	CU_SUITE_INFO_NULL,
 };
@@ -54,3 +54,14 @@  void odp_init_abort(void)
 {
 	abort();
 }
+
+static int init_main_abort(void)
+{
+	return odp_cunit_run(init_suites_abort);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return init_main_abort();
+}
diff --git a/test/validation/init/odp_init_log.c b/test/validation/init/odp_init_log.c
index fe1be71..ce7a628 100644
--- a/test/validation/init/odp_init_log.c
+++ b/test/validation/init/odp_init_log.c
@@ -45,12 +45,12 @@  static void test_odp_init_global_replace_log(void)
 	CU_ASSERT(status == 0);
 }
 
-CU_TestInfo test_odp_init[] = {
+static CU_TestInfo test_odp_init[] = {
 	{"replace log",  test_odp_init_global_replace_log},
 	CU_TEST_INFO_NULL,
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo init_suites_log[] = {
 	{"Init", NULL, NULL, NULL, NULL, test_odp_init},
 	CU_SUITE_INFO_NULL,
 };
@@ -70,3 +70,14 @@  int odp_init_log(odp_log_level_e level __attribute__((unused)),
 
 	return r;
 }
+
+static int init_main_log(void)
+{
+	return odp_cunit_run(init_suites_log);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return init_main_log();
+}