diff mbox

[4/5] validation: creating own dir and lib for buffer

Message ID 1435330910-15536-5-git-send-email-christophe.milard@linaro.org
State Accepted
Commit f02338077cf604e98c0eacd997832751270b3347
Headers show

Commit Message

Christophe Milard June 26, 2015, 3:01 p.m. UTC
Module buffer 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                       | 13 +++++--------
 test/validation/buffer/.gitignore                 |  2 ++
 test/validation/buffer/Makefile.am                |  8 ++++++++
 test/validation/{odp_buffer.c => buffer/buffer.c} |  9 ++-------
 test/validation/buffer/buffer.h                   |  7 +++++++
 test/validation/buffer/buffer_main.c              | 11 +++++++++++
 8 files changed, 36 insertions(+), 16 deletions(-)
 create mode 100644 test/validation/buffer/.gitignore
 create mode 100644 test/validation/buffer/Makefile.am
 rename test/validation/{odp_buffer.c => buffer/buffer.c} (96%)
 create mode 100644 test/validation/buffer/buffer.h
 create mode 100644 test/validation/buffer/buffer_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 67f3799..6bbbb11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,6 +303,7 @@  AC_CONFIG_FILES([Makefile
 		 test/api_test/Makefile
 		 test/performance/Makefile
 		 test/validation/Makefile
+		 test/validation/buffer/Makefile
 		 test/validation/classification/Makefile
 		 test/validation/common/Makefile
 		 test/validation/crypto/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 5346297..e1fb4f1 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -1,7 +1,6 @@ 
 *.log
 *.trs
 odp_ver_abt_log_dbg
-odp_buffer
 odp_cpumask
 odp_scheduler
 odp_shared_memory
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index c9aac49..2fb6195 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -4,8 +4,7 @@  include $(top_srcdir)/test/Makefile.inc
 AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
-EXECUTABLES = odp_buffer \
-	      odp_cpumask \
+EXECUTABLES = odp_cpumask \
 	      odp_scheduler \
 	      odp_shared_memory \
 	      odp_synchronizers \
@@ -14,17 +13,14 @@  EXECUTABLES = odp_buffer \
 	      odp_ver_abt_log_dbg
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	buffer/buffer_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 
 ODP_CU_COMMON=common/odp_cunit_common.c
 
-odp_buffer_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/buffer
-odp_buffer_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		   $(LIB)/libodp.la
-dist_odp_buffer_SOURCES = odp_buffer.c
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 odp_random_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
 		   $(LIB)/libodp.la
@@ -39,7 +35,8 @@  dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
 				    ver_abt_log_dbg/odp_errno.c \
                                     ver_abt_log_dbg/odp_ver_abt_log_dbg.c
 
-ODP_MODULES = classification \
+ODP_MODULES = buffer \
+	      classification \
 	      crypto \
 	      init \
 	      queue \
diff --git a/test/validation/buffer/.gitignore b/test/validation/buffer/.gitignore
new file mode 100644
index 0000000..01a6b36
--- /dev/null
+++ b/test/validation/buffer/.gitignore
@@ -0,0 +1,2 @@ 
+buffer_main
+libbuffer.a
diff --git a/test/validation/buffer/Makefile.am b/test/validation/buffer/Makefile.am
new file mode 100644
index 0000000..758c5fb
--- /dev/null
+++ b/test/validation/buffer/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libbuffer.a
+libbuffer_a_SOURCES = buffer.c
+
+bin_PROGRAMS = buffer_main
+dist_buffer_main_SOURCES = buffer_main.c
+buffer_main_LDADD = libbuffer.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_buffer.c b/test/validation/buffer/buffer.c
similarity index 96%
rename from test/validation/odp_buffer.c
rename to test/validation/buffer/buffer.c
index 65fa0d8..d0fd510 100644
--- a/test/validation/odp_buffer.c
+++ b/test/validation/buffer/buffer.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include "odp_cunit_common.h"
+#include "buffer.h"
 
 /* Helper macro for CU_TestInfo initialization */
 #define _CU_TEST_INFO(test_func) {#test_func, test_func}
@@ -157,13 +158,7 @@  static CU_SuiteInfo buffer_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int buffer_main(void)
+int buffer_main(void)
 {
 	return odp_cunit_run(buffer_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return buffer_main();
-}
diff --git a/test/validation/buffer/buffer.h b/test/validation/buffer/buffer.h
new file mode 100644
index 0000000..44d05a2
--- /dev/null
+++ b/test/validation/buffer/buffer.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+int buffer_main(void);
diff --git a/test/validation/buffer/buffer_main.c b/test/validation/buffer/buffer_main.c
new file mode 100644
index 0000000..b9b5146
--- /dev/null
+++ b/test/validation/buffer/buffer_main.c
@@ -0,0 +1,11 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+#include "buffer.h"
+
+int main(void)
+{
+	return buffer_main();
+}