diff mbox

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

Message ID 1435933656-6848-4-git-send-email-christophe.milard@linaro.org
State Accepted
Commit d929fab025d8d56807cdd28b33640e8535fe3fb7
Headers show

Commit Message

Christophe Milard July 3, 2015, 2:27 p.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 configure.ac                                           |  1 +
 test/validation/.gitignore                             |  1 -
 test/validation/Makefile.am                            | 11 ++++-------
 test/validation/shmem/.gitignore                       |  2 ++
 test/validation/shmem/Makefile.am                      |  8 ++++++++
 test/validation/{odp_shared_memory.c => shmem/shmem.c} |  9 ++-------
 test/validation/shmem/shmem.h                          |  7 +++++++
 test/validation/shmem/shmem_main.c                     | 12 ++++++++++++
 8 files changed, 36 insertions(+), 15 deletions(-)
 create mode 100644 test/validation/shmem/.gitignore
 create mode 100644 test/validation/shmem/Makefile.am
 rename test/validation/{odp_shared_memory.c => shmem/shmem.c} (94%)
 create mode 100644 test/validation/shmem/shmem.h
 create mode 100644 test/validation/shmem/shmem_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index f1de998..05719a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -319,6 +319,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/synchronizers/Makefile
 		 test/validation/thread/Makefile
 		 test/validation/time/Makefile
+		 test/validation/shmem/Makefile
 		 test/validation/system/Makefile
 		 test/miscellaneous/Makefile
 		 ])
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 50a459a..1a5eb04 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -1,4 +1,3 @@ 
 *.log
 *.trs
-odp_shared_memory
 odp_timer
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 6a02f0a..010c6bf 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -4,11 +4,11 @@  include $(top_srcdir)/test/Makefile.inc
 AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
-EXECUTABLES = odp_shared_memory$(EXEEXT) \
-	      odp_timer$(EXEEXT)
+EXECUTABLES = odp_timer$(EXEEXT)
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	shmem/shmem_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -16,10 +16,6 @@  bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 ODP_CU_COMMON=common/odp_cunit_common.c
 
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
-odp_shared_memory_LDADD = \
-	$(top_builddir)/test/validation/common/libcunit_common.a \
-	$(LIB)/libodp.la
-dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_timer_SOURCES  = odp_timer.c
 
 ODP_MODULES = buffer \
@@ -37,6 +33,7 @@  ODP_MODULES = buffer \
 	      synchronizers \
 	      thread \
 	      time \
+	      shmem \
 	      system
 
 SUBDIRS = common $(ODP_MODULES)
diff --git a/test/validation/shmem/.gitignore b/test/validation/shmem/.gitignore
new file mode 100644
index 0000000..3cb00eb
--- /dev/null
+++ b/test/validation/shmem/.gitignore
@@ -0,0 +1,2 @@ 
+shmem_main
+libshmem.a
diff --git a/test/validation/shmem/Makefile.am b/test/validation/shmem/Makefile.am
new file mode 100644
index 0000000..eb808ad
--- /dev/null
+++ b/test/validation/shmem/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libshmem.a
+libshmem_a_SOURCES = shmem.c
+
+bin_PROGRAMS = shmem_main$(EXEEXT)
+dist_shmem_main_SOURCES = shmem_main.c
+shmem_main_LDADD = libshmem.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_shared_memory.c b/test/validation/shmem/shmem.c
similarity index 94%
rename from test/validation/odp_shared_memory.c
rename to test/validation/shmem/shmem.c
index 050e3e5..0c713c6 100644
--- a/test/validation/odp_shared_memory.c
+++ b/test/validation/shmem/shmem.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include <odp_cunit_common.h>
+#include "shmem.h"
 
 #define ALIGE_SIZE  (128)
 #define TESTNAME "cunit_test_shared_data"
@@ -85,13 +86,7 @@  static CU_SuiteInfo shmem_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int shmem_main(void)
+int shmem_main(void)
 {
 	return odp_cunit_run(shmem_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return shmem_main();
-}
diff --git a/test/validation/shmem/shmem.h b/test/validation/shmem/shmem.h
new file mode 100644
index 0000000..9b79027
--- /dev/null
+++ b/test/validation/shmem/shmem.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int shmem_main(void);
diff --git a/test/validation/shmem/shmem_main.c b/test/validation/shmem/shmem_main.c
new file mode 100644
index 0000000..445fbf1
--- /dev/null
+++ b/test/validation/shmem/shmem_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "shmem.h"
+
+int main(void)
+{
+	return shmem_main();
+}