diff mbox

[10/10] example: m4: configure option to check examples

Message ID 1458758254-4703-11-git-send-email-anders.roxell@linaro.org
State Superseded
Headers show

Commit Message

Anders Roxell March 23, 2016, 6:37 p.m. UTC
Suggested-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 configure.ac                     |  1 +
 example/l2fwd_simple/Makefile.am |  2 ++
 example/m4/configure.m4          | 12 ++++++++++++
 3 files changed, 15 insertions(+)
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 1738e73..b878802 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,7 @@  AM_CONDITIONAL([dpdk_support], [test x$dpdk_support = xyes ])
 AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ])
 AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])
 AM_CONDITIONAL([SDK_INSTALL_PATH_], [test "x${SDK_INSTALL_PATH_}" = "x1"])
+AM_CONDITIONAL([test_example], [test x$test_example = xyes ])
 AM_CONDITIONAL([test_installdir], [test "$testdir" != ""])
 AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
 AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
diff --git a/example/l2fwd_simple/Makefile.am b/example/l2fwd_simple/Makefile.am
index 53b0e26..fe20654 100644
--- a/example/l2fwd_simple/Makefile.am
+++ b/example/l2fwd_simple/Makefile.am
@@ -9,7 +9,9 @@  noinst_HEADERS = \
 
 dist_odp_l2fwd_simple_SOURCES = odp_l2fwd_simple.c
 
+if test_example
 if HAVE_PCAP
 TESTS = l2fwd_simple_run.sh
 endif
+endif
 EXTRA_DIST = l2fwd_simple_run.sh udp64.pcap
diff --git a/example/m4/configure.m4 b/example/m4/configure.m4
index 74869ff..3a7211f 100644
--- a/example/m4/configure.m4
+++ b/example/m4/configure.m4
@@ -1,3 +1,15 @@ 
+##########################################################################
+# Enable/disable test-example
+##########################################################################
+test_example=no
+AC_ARG_ENABLE([test-example],
+    [  --enable-test-example       run basic test aginast examples],
+    [if test "x$enableval" = "xyes"; then
+        test_example=yes
+     else
+        test_example=no
+    fi])
+
 AC_CONFIG_FILES([example/classifier/Makefile
 		 example/generator/Makefile
 		 example/ipsec/Makefile