[API-NEXT,PATCHv2,4/5] test: validation: drv: adding the new drv interface

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

Commit Message

Christophe Milard July 29, 2016, 6:57 a.m.
The new structure for validation tests aiming the drv interface
of ODP is added (around a first DRV atomic test empty skeleton)

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

---
 test/common_plat/m4/configure.m4                   |  6 ++--
 test/common_plat/validation/Makefile.am            |  3 +-
 test/common_plat/validation/Makefile.inc           | 16 ++++++++++
 test/common_plat/validation/api/Makefile.inc       | 17 +----------
 test/common_plat/validation/drv/.gitignore         |  2 ++
 test/common_plat/validation/drv/Makefile.am        |  6 ++++
 test/common_plat/validation/drv/Makefile.inc       |  1 +
 test/common_plat/validation/drv/README             | 35 ++++++++++++++++++++++
 test/common_plat/validation/drv/atomic/Makefile.am |  4 +++
 .../validation/drv/atomic/atomic_main.c            | 10 +++++++
 test/linux-generic/Makefile.am                     |  2 ++
 11 files changed, 83 insertions(+), 19 deletions(-)
 create mode 100644 test/common_plat/validation/Makefile.inc
 create mode 100644 test/common_plat/validation/drv/.gitignore
 create mode 100644 test/common_plat/validation/drv/Makefile.am
 create mode 100644 test/common_plat/validation/drv/Makefile.inc
 create mode 100644 test/common_plat/validation/drv/README
 create mode 100644 test/common_plat/validation/drv/atomic/Makefile.am
 create mode 100644 test/common_plat/validation/drv/atomic/atomic_main.c

-- 
2.7.4

Patch

diff --git a/test/common_plat/m4/configure.m4 b/test/common_plat/m4/configure.m4
index be878bd..bfde6cb 100644
--- a/test/common_plat/m4/configure.m4
+++ b/test/common_plat/m4/configure.m4
@@ -7,6 +7,7 @@  AC_CONFIG_FILES([test/common_plat/Makefile
 		 test/common_plat/miscellaneous/Makefile
 		 test/common_plat/performance/Makefile
 		 test/common_plat/validation/Makefile
+		 test/common_plat/validation/api/Makefile
 		 test/common_plat/validation/api/atomic/Makefile
 		 test/common_plat/validation/api/barrier/Makefile
 		 test/common_plat/validation/api/buffer/Makefile
@@ -17,7 +18,6 @@  AC_CONFIG_FILES([test/common_plat/Makefile
 		 test/common_plat/validation/api/hash/Makefile
 		 test/common_plat/validation/api/init/Makefile
 		 test/common_plat/validation/api/lock/Makefile
-		 test/common_plat/validation/api/Makefile
 		 test/common_plat/validation/api/packet/Makefile
 		 test/common_plat/validation/api/pktio/Makefile
 		 test/common_plat/validation/api/pool/Makefile
@@ -30,4 +30,6 @@  AC_CONFIG_FILES([test/common_plat/Makefile
 		 test/common_plat/validation/api/thread/Makefile
 		 test/common_plat/validation/api/time/Makefile
 		 test/common_plat/validation/api/timer/Makefile
-		 test/common_plat/validation/api/traffic_mngr/Makefile])
+		 test/common_plat/validation/api/traffic_mngr/Makefile
+		 test/common_plat/validation/drv/Makefile
+		 test/common_plat/validation/drv/atomic/Makefile])
diff --git a/test/common_plat/validation/Makefile.am b/test/common_plat/validation/Makefile.am
index 5d525fb..ef58b25 100644
--- a/test/common_plat/validation/Makefile.am
+++ b/test/common_plat/validation/Makefile.am
@@ -1,3 +1,4 @@ 
 if cunit_support
-    SUBDIRS = api
+    SUBDIRS = api \
+	      drv
 endif
diff --git a/test/common_plat/validation/Makefile.inc b/test/common_plat/validation/Makefile.inc
new file mode 100644
index 0000000..ffba620
--- /dev/null
+++ b/test/common_plat/validation/Makefile.inc
@@ -0,0 +1,16 @@ 
+include $(top_srcdir)/test/Makefile.inc
+
+COMMON_DIR = $(top_builddir)/test/common_plat/common
+
+#the following option ensure that option '-I.' is not passed to gcc,
+#therefore distinguishing between '#include "X"' and '#include <X>'.
+#It allows common filenames (such as 'errno.h') to be used locally.
+AUTOMAKE_OPTIONS = nostdinc
+
+AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common
+AM_LDFLAGS += -static
+
+LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la
+LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la
+LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.la
+LIBODP = $(LIB)/libodphelper-linux.la $(LIB)/libodp-linux.la
diff --git a/test/common_plat/validation/api/Makefile.inc b/test/common_plat/validation/api/Makefile.inc
index ffba620..757ccad 100644
--- a/test/common_plat/validation/api/Makefile.inc
+++ b/test/common_plat/validation/api/Makefile.inc
@@ -1,16 +1 @@ 
-include $(top_srcdir)/test/Makefile.inc
-
-COMMON_DIR = $(top_builddir)/test/common_plat/common
-
-#the following option ensure that option '-I.' is not passed to gcc,
-#therefore distinguishing between '#include "X"' and '#include <X>'.
-#It allows common filenames (such as 'errno.h') to be used locally.
-AUTOMAKE_OPTIONS = nostdinc
-
-AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common
-AM_LDFLAGS += -static
-
-LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la
-LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la
-LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.la
-LIBODP = $(LIB)/libodphelper-linux.la $(LIB)/libodp-linux.la
+include $(top_srcdir)/test/common_plat/validation/Makefile.inc
diff --git a/test/common_plat/validation/drv/.gitignore b/test/common_plat/validation/drv/.gitignore
new file mode 100644
index 0000000..7e563b8
--- /dev/null
+++ b/test/common_plat/validation/drv/.gitignore
@@ -0,0 +1,2 @@ 
+*.log
+*.trs
diff --git a/test/common_plat/validation/drv/Makefile.am b/test/common_plat/validation/drv/Makefile.am
new file mode 100644
index 0000000..0dae3c3
--- /dev/null
+++ b/test/common_plat/validation/drv/Makefile.am
@@ -0,0 +1,6 @@ 
+ODPDRV_MODULES = atomic
+
+SUBDIRS = $(ODPDRV_MODULES)
+
+#The tests will need to retain the deprecated test implementation
+AM_CFLAGS += -Wno-deprecated-declarations
diff --git a/test/common_plat/validation/drv/Makefile.inc b/test/common_plat/validation/drv/Makefile.inc
new file mode 100644
index 0000000..757ccad
--- /dev/null
+++ b/test/common_plat/validation/drv/Makefile.inc
@@ -0,0 +1 @@ 
+include $(top_srcdir)/test/common_plat/validation/Makefile.inc
diff --git a/test/common_plat/validation/drv/README b/test/common_plat/validation/drv/README
new file mode 100644
index 0000000..d1a9e6f
--- /dev/null
+++ b/test/common_plat/validation/drv/README
@@ -0,0 +1,35 @@ 
+Copyright (c) 2016, Linaro Limited
+All rights reserved.
+
+SPDX-License-Identifier:        BSD-3-Clause
+
+
+To add tests in here, please observe the rules listed below. This list
+is a brief overview, for a more detailed explanation of the test
+framework refer to the ODP Implementers' Guide, which can built as
+follows:
+
+       ./configure --enable-user-guides
+       make
+
+Output will be in doc/output/. If this fails, check the documentation
+section of the DEPENDENCIES file.
+
+Rules for all tests under this tree:
+
+1. Tests must be placed in the directory of the module they belong to.
+
+2. Tests must be platform agnostic, i.e.
+
+    - should be written in plain C only.
+    - may only use C standard library functions, CUnit functions and of
+      course ODP functions
+    - should be expected to pass on all ODP implementations
+
+   Tests that do not follow these rules should be placed in the platform
+   specific test area (currently platform/<platform>/test/).
+
+3. If a new ODP DRV module is created, please update the Makefile.am.
+
+4. Symbols exported from test libraries must respect the naming
+   convention detailed in the ODP Implementers' Guide.
diff --git a/test/common_plat/validation/drv/atomic/Makefile.am b/test/common_plat/validation/drv/atomic/Makefile.am
new file mode 100644
index 0000000..be48623
--- /dev/null
+++ b/test/common_plat/validation/drv/atomic/Makefile.am
@@ -0,0 +1,4 @@ 
+include ../Makefile.inc
+
+test_PROGRAMS = atomic_main$(EXEEXT)
+dist_atomic_main_SOURCES = atomic_main.c
diff --git a/test/common_plat/validation/drv/atomic/atomic_main.c b/test/common_plat/validation/drv/atomic/atomic_main.c
new file mode 100644
index 0000000..44fb710
--- /dev/null
+++ b/test/common_plat/validation/drv/atomic/atomic_main.c
@@ -0,0 +1,10 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int main(void)
+{
+	return 0;
+}
diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.am
index f5cc52d..1cee6e7 100644
--- a/test/linux-generic/Makefile.am
+++ b/test/linux-generic/Makefile.am
@@ -2,6 +2,7 @@  include $(top_srcdir)/test/Makefile.inc
 TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/common_plat/validation
 
 ALL_API_VALIDATION_DIR = ${top_builddir}/test/common_plat/validation/api
+ALL_DRV_VALIDATION_DIR = ${top_builddir}/test/common_plat/validation/drv
 
 SUBDIRS =
 
@@ -33,6 +34,7 @@  TESTS = validation/api/pktio/pktio_run.sh \
 	$(ALL_API_VALIDATION_DIR)/traffic_mngr/traffic_mngr_main$(EXEEXT) \
 	$(ALL_API_VALIDATION_DIR)/shmem/shmem_main$(EXEEXT) \
 	$(ALL_API_VALIDATION_DIR)/system/system_main$(EXEEXT) \
+	$(ALL_DRV_VALIDATION_DIR)/atomic/atomic_main$(EXEEXT) \
 	ring/ring_main$(EXEEXT)
 
 SUBDIRS += validation/api/pktio\