diff mbox

[PATCHv2,4/5] validation: creating own dir and lib for packet

Message ID 1435582101-18831-5-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard June 29, 2015, 12:48 p.m. UTC
Module packet now gets its own directory and create its own lib
(currentely only containing its executable)

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 configure.ac                                      |  1 +
 test/validation/.gitignore                        |  1 -
 test/validation/Makefile.am                       |  8 +++-----
 test/validation/packet/.gitignore                 |  2 ++
 test/validation/packet/Makefile.am                |  8 ++++++++
 test/validation/{odp_packet.c => packet/packet.c} |  9 ++-------
 test/validation/packet/packet.h                   |  7 +++++++
 test/validation/packet/packet_main.c              | 12 ++++++++++++
 8 files changed, 35 insertions(+), 13 deletions(-)
 create mode 100644 test/validation/packet/.gitignore
 create mode 100644 test/validation/packet/Makefile.am
 rename test/validation/{odp_packet.c => packet/packet.c} (99%)
 create mode 100644 test/validation/packet/packet.h
 create mode 100644 test/validation/packet/packet_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index b72df2e..67f3799 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,6 +307,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/common/Makefile
 		 test/validation/crypto/Makefile
 		 test/validation/init/Makefile
+		 test/validation/packet/Makefile
 		 test/validation/pktio/Makefile
 		 test/validation/pool/Makefile
 		 test/validation/queue/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index cf8c044..5346297 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -3,7 +3,6 @@ 
 odp_ver_abt_log_dbg
 odp_buffer
 odp_cpumask
-odp_packet
 odp_scheduler
 odp_shared_memory
 odp_synchronizers
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 2ce00a0..4b158a3 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -6,7 +6,6 @@  AM_LDFLAGS += -static
 
 EXECUTABLES = odp_buffer \
 	      odp_cpumask \
-	      odp_packet \
 	      odp_scheduler \
 	      odp_shared_memory \
 	      odp_synchronizers \
@@ -15,7 +14,8 @@  EXECUTABLES = odp_buffer \
 	      odp_ver_abt_log_dbg
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	packet/packet_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -31,9 +31,6 @@  dist_odp_scheduler_SOURCES = odp_scheduler.c
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
 dist_odp_timer_SOURCES  = odp_timer.c
-odp_packet_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		   $(LIB)/libodp.la
-dist_odp_packet_SOURCES = odp_packet.c
 dist_odp_cpumask_SOURCES = odp_cpumask.c
 dist_odp_thread_SOURCES = odp_thread.c
 odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
@@ -45,6 +42,7 @@  ODP_MODULES = classification \
 	      crypto \
 	      init \
 	      queue \
+	      packet \
 	      pktio \
 	      pool \
 	      random \
diff --git a/test/validation/packet/.gitignore b/test/validation/packet/.gitignore
new file mode 100644
index 0000000..36fb9d3
--- /dev/null
+++ b/test/validation/packet/.gitignore
@@ -0,0 +1,2 @@ 
+libpacket.a
+packet_main
diff --git a/test/validation/packet/Makefile.am b/test/validation/packet/Makefile.am
new file mode 100644
index 0000000..fdecb0d
--- /dev/null
+++ b/test/validation/packet/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libpacket.a
+libpacket_a_SOURCES = packet.c
+
+bin_PROGRAMS = packet_main
+dist_packet_main_SOURCES = packet_main.c
+packet_main_LDADD = libpacket.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_packet.c b/test/validation/packet/packet.c
similarity index 99%
rename from test/validation/odp_packet.c
rename to test/validation/packet/packet.c
index eb8e615..619d5b4 100644
--- a/test/validation/odp_packet.c
+++ b/test/validation/packet/packet.c
@@ -8,6 +8,7 @@ 
 
 #include <odp.h>
 #include "odp_cunit_common.h"
+#include "packet.h"
 
 /* Helper macro for CU_TestInfo initialization */
 #define _CU_TEST_INFO(test_func) {#test_func, test_func}
@@ -731,13 +732,7 @@  static CU_SuiteInfo packet_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int packet_main(void)
+int packet_main(void)
 {
 	return odp_cunit_run(packet_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return packet_main();
-}
diff --git a/test/validation/packet/packet.h b/test/validation/packet/packet.h
new file mode 100644
index 0000000..421bc25
--- /dev/null
+++ b/test/validation/packet/packet.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+int packet_main(void);
diff --git a/test/validation/packet/packet_main.c b/test/validation/packet/packet_main.c
new file mode 100644
index 0000000..90972fd
--- /dev/null
+++ b/test/validation/packet/packet_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+#include "packet.h"
+
+int main(void)
+{
+	return packet_main();
+}