diff mbox

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

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

Commit Message

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

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

Patch

diff --git a/configure.ac b/configure.ac
index f58b472..2aa804d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -308,6 +308,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/crypto/Makefile
 		 test/validation/init/Makefile
 		 test/validation/pktio/Makefile
+		 test/validation/queue/Makefile
 		 test/validation/random/Makefile
 		 test/validation/system/Makefile
 		 test/miscellaneous/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 067914f..a8faaa2 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -5,7 +5,6 @@  odp_buffer
 odp_cpumask
 odp_packet
 odp_pool
-odp_queue
 odp_scheduler
 odp_shared_memory
 odp_synchronizers
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 1a774e1..8a24449 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -8,7 +8,6 @@  EXECUTABLES = odp_buffer \
 	      odp_cpumask \
 	      odp_packet \
 	      odp_pool \
-	      odp_queue \
 	      odp_scheduler \
 	      odp_shared_memory \
 	      odp_synchronizers \
@@ -17,7 +16,8 @@  EXECUTABLES = odp_buffer \
 	      odp_ver_abt_log_dbg
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	queue/queue_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -27,9 +27,6 @@  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_queue_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		  $(LIB)/libodp.la
-dist_odp_queue_SOURCES	= odp_queue.c
 dist_odp_scheduler_SOURCES = odp_scheduler.c
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
@@ -46,6 +43,7 @@  dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
 ODP_MODULES = classification \
 	      crypto \
 	      init \
+	      queue \
 	      pktio \
 	      random \
 	      system
diff --git a/test/validation/queue/.gitignore b/test/validation/queue/.gitignore
new file mode 100644
index 0000000..c9e4029
--- /dev/null
+++ b/test/validation/queue/.gitignore
@@ -0,0 +1,2 @@ 
+libqueue.a
+queue_main
diff --git a/test/validation/queue/Makefile.am b/test/validation/queue/Makefile.am
new file mode 100644
index 0000000..93acd3c
--- /dev/null
+++ b/test/validation/queue/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libqueue.a
+libqueue_a_SOURCES = queue.c
+
+bin_PROGRAMS = queue_main
+dist_queue_main_SOURCES = queue_main.c
+queue_main_LDADD = libqueue.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_queue.c b/test/validation/queue/queue.c
similarity index 95%
rename from test/validation/odp_queue.c
rename to test/validation/queue/queue.c
index cf6f328..f686b71 100644
--- a/test/validation/odp_queue.c
+++ b/test/validation/queue/queue.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include <odp_cunit_common.h>
+#include "queue.h"
 
 #define MAX_BUFFER_QUEUE        (8)
 #define MSG_POOL_SIZE           (4 * 1024 * 1024)
@@ -117,13 +118,7 @@  static CU_SuiteInfo queue_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int queue_main(void)
+int queue_main(void)
 {
 	return odp_cunit_run(queue_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return queue_main();
-}
diff --git a/test/validation/queue/queue.h b/test/validation/queue/queue.h
new file mode 100644
index 0000000..3e9a9f1
--- /dev/null
+++ b/test/validation/queue/queue.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int queue_main(void);
diff --git a/test/validation/queue/queue_main.c b/test/validation/queue/queue_main.c
new file mode 100644
index 0000000..326f131
--- /dev/null
+++ b/test/validation/queue/queue_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "queue.h"
+
+int main(void)
+{
+	return queue_main();
+}