[v12,1/2] example: generator: move script back to example directory

Message ID 1519826413-28417-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • More tests rework
Related show

Commit Message

Github ODP bot Feb. 28, 2018, 2 p.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Move script back to examples dir, so that platform other than
linux-generic might be able to run this test/example, if they choose to
implement null: PktIO type.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 496 (lumag:tests-fix-2)
 ** https://github.com/Linaro/odp/pull/496
 ** Patch: https://github.com/Linaro/odp/pull/496.patch
 ** Base sha: f5e12df388352b27f09787028a0040afb28564f4
 ** Merge commit sha: 15eadb7d8c8d6d10d976c1f7c67d847e9be8301a
 **/
 example/generator/Makefile.am                      |  8 ++++
 example/generator/generator_null_test.sh           | 23 +++++++++++
 platform/linux-generic/m4/configure.m4             |  2 -
 platform/linux-generic/test/Makefile.am            |  4 --
 platform/linux-generic/test/example/Makefile.am    |  1 -
 .../test/example/generator/Makefile.am             |  4 --
 .../test/example/generator/generator_run.sh        | 45 ----------------------
 7 files changed, 31 insertions(+), 56 deletions(-)
 create mode 100755 example/generator/generator_null_test.sh
 delete mode 100644 platform/linux-generic/test/example/Makefile.am
 delete mode 100644 platform/linux-generic/test/example/generator/Makefile.am
 delete mode 100755 platform/linux-generic/test/example/generator/generator_run.sh

Patch

diff --git a/example/generator/Makefile.am b/example/generator/Makefile.am
index 7deeef406..112ebbf63 100644
--- a/example/generator/Makefile.am
+++ b/example/generator/Makefile.am
@@ -3,3 +3,11 @@  include $(top_srcdir)/example/Makefile.inc
 bin_PROGRAMS = odp_generator
 
 odp_generator_SOURCES = odp_generator.c
+
+TEST_EXTENSIONS = .sh
+
+if test_example
+TESTS = generator_null_test.sh
+TESTS_ENVIRONMENT += ODP_PLATFORM=$(with_platform)
+endif
+EXTRA_DIST = generator_null_test.sh
diff --git a/example/generator/generator_null_test.sh b/example/generator/generator_null_test.sh
new file mode 100755
index 000000000..a598ffd92
--- /dev/null
+++ b/example/generator/generator_null_test.sh
@@ -0,0 +1,23 @@ 
+#!/bin/bash
+#
+# Copyright (c) 2018, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:     BSD-3-Clause
+#
+
+if [ -n "${ODP_PLATFORM}" -a "x${ODP_PLATFORM}" != "xlinux-generic" ]
+then
+	echo "null pktio might be unsupported on this platform, skipping"
+	exit 77
+fi
+
+./odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u
+STATUS=$?
+
+if [ "$STATUS" -ne 0 ]; then
+  echo "Error: status was: $STATUS, expected 0"
+  exit 1
+fi
+
+exit 0
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 935894b8c..7fa3652e2 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -19,8 +19,6 @@  AM_CONDITIONAL([PLATFORM_IS_LINUX_GENERIC],
 AC_CONFIG_FILES([platform/linux-generic/Makefile
 		 platform/linux-generic/libodp-linux.pc
 		 platform/linux-generic/test/Makefile
-		 platform/linux-generic/test/example/Makefile
-		 platform/linux-generic/test/example/generator/Makefile
 		 platform/linux-generic/test/validation/api/shmem/Makefile
 		 platform/linux-generic/test/validation/api/pktio/Makefile
 		 platform/linux-generic/test/mmap_vlan_ins/Makefile
diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am
index e317ff736..99934099a 100644
--- a/platform/linux-generic/test/Makefile.am
+++ b/platform/linux-generic/test/Makefile.am
@@ -3,10 +3,6 @@  TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation
 
 SUBDIRS = performance
 
-if test_example
-SUBDIRS += example
-endif
-
 if test_vald
 TESTS = validation/api/pktio/pktio_run.sh \
 	validation/api/pktio/pktio_run_tap.sh \
diff --git a/platform/linux-generic/test/example/Makefile.am b/platform/linux-generic/test/example/Makefile.am
deleted file mode 100644
index 41d287522..000000000
--- a/platform/linux-generic/test/example/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@ 
-SUBDIRS = generator
diff --git a/platform/linux-generic/test/example/generator/Makefile.am b/platform/linux-generic/test/example/generator/Makefile.am
deleted file mode 100644
index 3bdfdc69c..000000000
--- a/platform/linux-generic/test/example/generator/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@ 
-TESTS_ENVIRONMENT = EXAMPLE_DIR=${top_builddir}/example/generator
-
-TESTS = generator_run.sh
-EXTRA_DIST = generator_run.sh
diff --git a/platform/linux-generic/test/example/generator/generator_run.sh b/platform/linux-generic/test/example/generator/generator_run.sh
deleted file mode 100755
index 85368d2eb..000000000
--- a/platform/linux-generic/test/example/generator/generator_run.sh
+++ /dev/null
@@ -1,45 +0,0 @@ 
-#!/bin/bash
-#
-# Copyright (c) 2018-2018, Linaro Limited
-# All rights reserved.
-#
-# SPDX-License-Identifier:     BSD-3-Clause
-#
-
-# directory where platform test sources are, including scripts
-TEST_SRC_DIR=$(dirname $0)
-
-# exit codes expected by automake for skipped tests
-TEST_SKIPPED=77
-
-# directories where binary can be found:
-# -in the validation dir when running make check (intree or out of tree)
-# -in the script directory, when running after 'make install', or
-# -in the validation when running standalone intree.
-# -in the current directory.
-# running stand alone out of tree requires setting PATH
-PATH="${EXAMPLE_DIR}/:$PATH"
-PATH="`pwd`/example/generator/:$PATH"
-PATH="$(dirname $0)/../../../../../example/generator:$PATH"
-PATH=".:$PATH"
-
-bin_path=$(which odp_generator${EXEEXT})
-if [ -x "$bin_path" ] ; then
-	echo "running with odp_generator: $bin_path"
-else
-	echo "cannot odp_generator: please set you PATH for it."
-	pwd
-	echo $PATH
-	exit 1
-fi
-
-
-odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u
-STATUS=$?
-
-if [ "$STATUS" -ne 0 ]; then
-  echo "Error: status was: $STATUS, expected 0"
-  exit 1
-fi
-
-exit 0