diff mbox

[PATCHv3,4/5] validation: creating own dir for classification

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

Commit Message

Christophe Milard June 23, 2015, 9:21 a.m. UTC
Module classification 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                                | 14 ++++----------
 test/validation/classification/.gitignore                  |  2 ++
 test/validation/classification/Makefile.am                 | 10 ++++++++++
 .../classification.c}                                      |  9 ++-------
 test/validation/classification/classification.h            |  7 +++++++
 test/validation/classification/classification_main.c       | 12 ++++++++++++
 8 files changed, 38 insertions(+), 18 deletions(-)
 create mode 100644 test/validation/classification/.gitignore
 create mode 100644 test/validation/classification/Makefile.am
 rename test/validation/{odp_classification.c => classification/classification.c} (78%)
 create mode 100644 test/validation/classification/classification.h
 create mode 100644 test/validation/classification/classification_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 3010789..f70bafe 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/classification/Makefile
 		 test/validation/common/Makefile
 		 test/validation/crypto/Makefile
 		 test/validation/pktio/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 765c8b0..563eee9 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -2,7 +2,6 @@ 
 *.trs
 odp_ver_abt_log_dbg
 odp_buffer
-odp_classification
 odp_cpumask
 odp_init
 odp_init_abort
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 227e7a2..bbf7447 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -5,7 +5,6 @@  AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
 EXECUTABLES = odp_buffer \
-	      odp_classification \
 	      odp_cpumask \
 	      odp_init \
 	      odp_init_abort \
@@ -23,7 +22,8 @@  EXECUTABLES = odp_buffer \
 	      odp_ver_abt_log_dbg
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	classification/classification_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -32,13 +32,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_classification_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/classification
-odp_classification_LDADD = \
-	$(top_builddir)/test/validation/common/libcunit_common.a \
-	$(LIB)/libodp.la
-dist_odp_classification_SOURCES = classification/odp_classification_tests.c \
-				classification/odp_classification_basic.c \
-				odp_classification.c
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_init_SOURCES	= init/odp_init.c
 dist_odp_init_abort_SOURCES = init/odp_init_abort.c
@@ -59,7 +52,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 = crypto \
+ODP_MODULES = classification \
+	      crypto \
 	      pktio
 
 SUBDIRS = common $(ODP_MODULES)
diff --git a/test/validation/classification/.gitignore b/test/validation/classification/.gitignore
new file mode 100644
index 0000000..3887aec
--- /dev/null
+++ b/test/validation/classification/.gitignore
@@ -0,0 +1,2 @@ 
+classification_main
+libclassification.a
diff --git a/test/validation/classification/Makefile.am b/test/validation/classification/Makefile.am
new file mode 100644
index 0000000..1413c20
--- /dev/null
+++ b/test/validation/classification/Makefile.am
@@ -0,0 +1,10 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libclassification.a
+libclassification_a_SOURCES = odp_classification_basic.c \
+			      odp_classification_tests.c \
+			      classification.c
+
+bin_PROGRAMS = classification_main
+dist_classification_main_SOURCES = classification_main.c
+classification_main_LDADD = libclassification.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_classification.c b/test/validation/classification/classification.c
similarity index 78%
rename from test/validation/odp_classification.c
rename to test/validation/classification/classification.c
index 69cdd4b..2582aaa 100644
--- a/test/validation/odp_classification.c
+++ b/test/validation/classification/classification.c
@@ -7,6 +7,7 @@ 
 #include <odp.h>
 #include <odp_cunit_common.h>
 #include "odp_classification_testsuites.h"
+#include "classification.h"
 
 static CU_SuiteInfo classification_suites[] = {
 	{ .pName = "classification basic",
@@ -20,13 +21,7 @@  static CU_SuiteInfo classification_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int classification_main(void)
+int classification_main(void)
 {
 	return odp_cunit_run(classification_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return classification_main();
-}
diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h
new file mode 100644
index 0000000..e677343
--- /dev/null
+++ b/test/validation/classification/classification.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int classification_main(void);
diff --git a/test/validation/classification/classification_main.c b/test/validation/classification/classification_main.c
new file mode 100644
index 0000000..712fada
--- /dev/null
+++ b/test/validation/classification/classification_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "classification.h"
+
+int main(void)
+{
+	return classification_main();
+}