diff mbox

[3/4] validation: creating own dir and lib for pool

Message ID 1435242154-21503-4-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 2ada447f93aa7585ac69a6d78baeed9d976f2ffe
Headers show

Commit Message

Christophe Milard June 25, 2015, 2:22 p.m. UTC
Module poll 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/pool/Makefile.am            |  8 ++++++++
 test/validation/{odp_pool.c => pool/pool.c} |  9 ++-------
 test/validation/pool/pool.h                 |  7 +++++++
 test/validation/pool/pool_main.c            | 12 ++++++++++++
 7 files changed, 33 insertions(+), 13 deletions(-)
 create mode 100644 test/validation/pool/Makefile.am
 rename test/validation/{odp_pool.c => pool/pool.c} (96%)
 create mode 100644 test/validation/pool/pool.h
 create mode 100644 test/validation/pool/pool_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 2aa804d..b72df2e 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/pool/Makefile
 		 test/validation/queue/Makefile
 		 test/validation/random/Makefile
 		 test/validation/system/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index a8faaa2..cf8c044 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -4,7 +4,6 @@  odp_ver_abt_log_dbg
 odp_buffer
 odp_cpumask
 odp_packet
-odp_pool
 odp_scheduler
 odp_shared_memory
 odp_synchronizers
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index b0e577c..ff88a68 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -7,7 +7,6 @@  AM_LDFLAGS += -static
 EXECUTABLES = odp_buffer \
 	      odp_cpumask \
 	      odp_packet \
-	      odp_pool \
 	      odp_scheduler \
 	      odp_shared_memory \
 	      odp_synchronizers \
@@ -16,7 +15,8 @@  EXECUTABLES = odp_buffer \
 	      odp_ver_abt_log_dbg
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	pool/pool_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -33,9 +33,6 @@  dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
 dist_odp_timer_SOURCES  = odp_timer.c
 dist_odp_packet_SOURCES = odp_packet.c
-odp_pool_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		 $(LIB)/libodp.la
-dist_odp_pool_SOURCES = odp_pool.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
@@ -48,6 +45,7 @@  ODP_MODULES = classification \
 	      init \
 	      queue \
 	      pktio \
+	      pool \
 	      random \
 	      system
 
diff --git a/test/validation/pool/Makefile.am b/test/validation/pool/Makefile.am
new file mode 100644
index 0000000..54fb4ac
--- /dev/null
+++ b/test/validation/pool/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libpool.a
+libpool_a_SOURCES = pool.c
+
+bin_PROGRAMS = pool_main
+dist_pool_main_SOURCES = pool_main.c
+pool_main_LDADD = libpool.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_pool.c b/test/validation/pool/pool.c
similarity index 96%
rename from test/validation/odp_pool.c
rename to test/validation/pool/pool.c
index ba5dc79..1b54033 100644
--- a/test/validation/odp_pool.c
+++ b/test/validation/pool/pool.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include "odp_cunit_common.h"
+#include "pool.h"
 
 static int pool_name_number = 1;
 static const int default_buffer_size = 1500;
@@ -143,13 +144,7 @@  static CU_SuiteInfo pool_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int pool_main(void)
+int pool_main(void)
 {
 	return odp_cunit_run(pool_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return pool_main();
-}
diff --git a/test/validation/pool/pool.h b/test/validation/pool/pool.h
new file mode 100644
index 0000000..53cd4d1
--- /dev/null
+++ b/test/validation/pool/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+int pool_main(void);
diff --git a/test/validation/pool/pool_main.c b/test/validation/pool/pool_main.c
new file mode 100644
index 0000000..5ef739e
--- /dev/null
+++ b/test/validation/pool/pool_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+#include "pool.h"
+
+int main(void)
+{
+	return pool_main();
+}