@@ -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 \
@@ -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();
+}
@@ -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();
+}
@@ -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();
+}
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(-)