diff mbox

[PATCHv2,2/7] validation: own main in odp_pktio.c

Message ID 1433349890-2903-3-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard June 3, 2015, 4:44 p.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 test/Makefile.inc           |  7 ++++++-
 test/validation/Makefile.am |  8 +++-----
 test/validation/odp_pktio.c | 15 +++++++++++++--
 3 files changed, 22 insertions(+), 8 deletions(-)

Comments

Stuart Haslam June 4, 2015, 9:01 a.m. UTC | #1
On Wed, Jun 03, 2015 at 06:44:45PM +0200, Christophe Milard wrote:
> Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
> ---
>  test/Makefile.inc           |  7 ++++++-
>  test/validation/Makefile.am |  8 +++-----
>  test/validation/odp_pktio.c | 15 +++++++++++++--
>  3 files changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git a/test/Makefile.inc b/test/Makefile.inc
> index e20a848..27b966f 100644
> --- a/test/Makefile.inc
> +++ b/test/Makefile.inc
> @@ -1,7 +1,12 @@
>  include $(top_srcdir)/Makefile.inc
>  include $(top_srcdir)/platform/@with_platform@/Makefile.inc
>  LIB   = $(top_builddir)/lib
> -LDADD = $(LIB)/libodp.la
> +
> +#in the following line, the libs using the symbols should come before
> +#the libs using them! 

s/using/containing/?
diff mbox

Patch

diff --git a/test/Makefile.inc b/test/Makefile.inc
index e20a848..27b966f 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -1,7 +1,12 @@ 
 include $(top_srcdir)/Makefile.inc
 include $(top_srcdir)/platform/@with_platform@/Makefile.inc
 LIB   = $(top_builddir)/lib
-LDADD = $(LIB)/libodp.la
+
+#in the following line, the libs using the symbols should come before
+#the libs using them! The includer is given a chance to add things before libodp
+#by setting PRE_LDADD before the inclusion.
+LDADD = $(PRE_LDADD) $(LIB)/libodp.la
+
 INCFLAGS = -I$(srcdir) \
 	-I$(top_srcdir)/test \
 	-I$(top_srcdir)/platform/@with_platform@/include \
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 965f603..d4bbdb5 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -1,13 +1,9 @@ 
+PRE_LDADD = $(top_builddir)/test/validation/common/libcunit_common_as_main.a
 include $(top_srcdir)/test/Makefile.inc
 
 AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
-#warning: in the following line, the libs using the symbols should come before
-#the libs using them!
-LDADD = $(top_builddir)/test/validation/common/libcunit_common_as_main.a \
-	$(LIB)/libodp.la
-
 TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform} TEST_DIR=${builddir}
 
 EXECUTABLES = odp_buffer \
@@ -62,6 +58,8 @@  dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
 dist_odp_time_SOURCES   = odp_time.c
 dist_odp_timer_SOURCES  = odp_timer.c
+odp_pktio_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
+	$(LIB)/libodp.la
 dist_odp_pktio_SOURCES	= odp_pktio.c
 dist_odp_packet_SOURCES = odp_packet.c
 dist_odp_pool_SOURCES = odp_pool.c
diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index 7c1a666..592136f 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -688,7 +688,7 @@  static int term_pktio_suite(void)
 	return ret;
 }
 
-CU_TestInfo pktio_tests[] = {
+static CU_TestInfo pktio_tests[] = {
 	{"pktio open",		test_odp_pktio_open},
 	{"pktio lookup",	test_odp_pktio_lookup},
 	{"pktio inq",		test_odp_pktio_inq},
@@ -704,8 +704,19 @@  CU_TestInfo pktio_tests[] = {
 	CU_TEST_INFO_NULL
 };
 
-CU_SuiteInfo odp_testsuites[] = {
+static CU_SuiteInfo pktio_suites[] = {
 	{"Packet I/O",
 		init_pktio_suite, term_pktio_suite, NULL, NULL, pktio_tests},
 	CU_SUITE_INFO_NULL
 };
+
+static int pktio_main(void)
+{
+	return odp_cunit_run(pktio_suites);
+}
+
+/* the following main function will be separated when lib is created */
+int main(void)
+{
+	return pktio_main();
+}