diff mbox

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

Message ID 1435745141-1078-5-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 110fa0751033bc60f47c7b6b357358762213d286
Headers show

Commit Message

Christophe Milard July 1, 2015, 10:05 a.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 configure.ac                                         |  1 +
 test/validation/.gitignore                           |  1 -
 test/validation/Makefile.am                          | 10 ++++------
 test/validation/cpumask/.gitignore                   |  2 ++
 test/validation/cpumask/Makefile.am                  |  8 ++++++++
 test/validation/{odp_cpumask.c => cpumask/cpumask.c} |  9 ++-------
 test/validation/cpumask/cpumask.h                    |  7 +++++++
 test/validation/cpumask/cpumask_main.c               | 11 +++++++++++
 8 files changed, 35 insertions(+), 14 deletions(-)
 create mode 100644 test/validation/cpumask/.gitignore
 create mode 100644 test/validation/cpumask/Makefile.am
 rename test/validation/{odp_cpumask.c => cpumask/cpumask.c} (98%)
 create mode 100644 test/validation/cpumask/cpumask.h
 create mode 100644 test/validation/cpumask/cpumask_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index c036040..d27e899 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,6 +305,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/Makefile
 		 test/validation/buffer/Makefile
 		 test/validation/classification/Makefile
+		 test/validation/cpumask/Makefile
 		 test/validation/common/Makefile
 		 test/validation/crypto/Makefile
 		 test/validation/init/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index b274a79..676f6f1 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -1,7 +1,6 @@ 
 *.log
 *.trs
 odp_ver_abt_log_dbg
-odp_cpumask
 odp_shared_memory
 odp_synchronizers
 odp_timer
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 8e429d9..1c7a206 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -4,14 +4,14 @@  include $(top_srcdir)/test/Makefile.inc
 AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
-EXECUTABLES = odp_cpumask$(EXEEXT) \
-	      odp_shared_memory$(EXEEXT) \
+EXECUTABLES = odp_shared_memory$(EXEEXT) \
 	      odp_synchronizers$(EXEEXT) \
 	      odp_timer$(EXEEXT) \
 	      odp_ver_abt_log_dbg$(EXEEXT)
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	cpumask/cpumask_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -22,9 +22,6 @@  odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
 dist_odp_timer_SOURCES  = odp_timer.c
-odp_cpumask_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		    $(LIB)/libodp.la
-dist_odp_cpumask_SOURCES = odp_cpumask.c
 odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
 dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
 				    ver_abt_log_dbg/odp_errno.c \
@@ -32,6 +29,7 @@  dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
 
 ODP_MODULES = buffer \
 	      classification \
+	      cpumask \
 	      crypto \
 	      init \
 	      queue \
diff --git a/test/validation/cpumask/.gitignore b/test/validation/cpumask/.gitignore
new file mode 100644
index 0000000..1dd4350
--- /dev/null
+++ b/test/validation/cpumask/.gitignore
@@ -0,0 +1,2 @@ 
+cpumask_main
+libcpumask.a
diff --git a/test/validation/cpumask/Makefile.am b/test/validation/cpumask/Makefile.am
new file mode 100644
index 0000000..61b65ec
--- /dev/null
+++ b/test/validation/cpumask/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libcpumask.a
+libcpumask_a_SOURCES = cpumask.c
+
+bin_PROGRAMS = cpumask_main$(EXEEXT)
+dist_cpumask_main_SOURCES = cpumask_main.c
+cpumask_main_LDADD = libcpumask.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_cpumask.c b/test/validation/cpumask/cpumask.c
similarity index 98%
rename from test/validation/odp_cpumask.c
rename to test/validation/cpumask/cpumask.c
index 1a78cd9..943a8e0 100644
--- a/test/validation/odp_cpumask.c
+++ b/test/validation/cpumask/cpumask.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include "odp_cunit_common.h"
+#include "cpumask.h"
 
 /*
  * The following string are used to build cpu masks with
@@ -478,13 +479,7 @@  static CU_SuiteInfo cpumask_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int cpumask_main(void)
+int cpumask_main(void)
 {
 	return odp_cunit_run(cpumask_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return cpumask_main();
-}
diff --git a/test/validation/cpumask/cpumask.h b/test/validation/cpumask/cpumask.h
new file mode 100644
index 0000000..c0d19a9
--- /dev/null
+++ b/test/validation/cpumask/cpumask.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int cpumask_main(void);
diff --git a/test/validation/cpumask/cpumask_main.c b/test/validation/cpumask/cpumask_main.c
new file mode 100644
index 0000000..ceac674
--- /dev/null
+++ b/test/validation/cpumask/cpumask_main.c
@@ -0,0 +1,11 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+#include "cpumask.h"
+
+int main(void)
+{
+	return cpumask_main();
+}