diff mbox

configure: Fix broken conditional example execution

Message ID 1460737324-8720-1-git-send-email-mike.holmes@linaro.org
State Superseded
Headers show

Commit Message

Mike Holmes April 15, 2016, 4:22 p.m. UTC
The configure environment was incorrect and the examples always run with
make check

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 configure.ac               | 2 ++
 example/m4/configure.m4    | 2 +-
 example/switch/Makefile.am | 6 ++++--
 3 files changed, 7 insertions(+), 3 deletions(-)

Comments

Ricardo Salveti April 15, 2016, 6:22 p.m. UTC | #1
On Fri, Apr 15, 2016 at 1:22 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
> The configure environment was incorrect and the examples always run with
> make check
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>  configure.ac               | 2 ++
>  example/m4/configure.m4    | 2 +-
>  example/switch/Makefile.am | 6 ++++--
>  3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 9665d1d..9acc203 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -141,6 +141,7 @@ AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
>  AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ])
>  AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ])
>  AM_CONDITIONAL([test_helper], [test x$test_helper = xyes ])
> +AM_CONDITIONAL([test_example], [test x$test_example = xyes ])
>  AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"])
>  AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ])
>  AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"])
> @@ -243,5 +244,6 @@ AC_MSG_RESULT([
>         test_perf:              ${test_perf}
>         test_cpp:               ${test_cpp}
>         test_helper:            ${test_helper}
> +       test_example:           ${test_example}
>         user_guides:            ${user_guides}
>  ])
> diff --git a/example/m4/configure.m4 b/example/m4/configure.m4
> index 229fed5..11f9fdf 100644
> --- a/example/m4/configure.m4
> +++ b/example/m4/configure.m4
> @@ -3,7 +3,7 @@
>  ##########################################################################
>  test_example=no
>  AC_ARG_ENABLE([test-example],
> -    [  --enable-test-example       run basic test aginast examples],
> +    [  --enable-test-example   run basic test aginast examples],

Typo, should be "against". Was already there, but since you are
changing the line, mind fixing as well?

>      [if test "x$enableval" = "xyes"; then
>          test_example=yes
>       else
> diff --git a/example/switch/Makefile.am b/example/switch/Makefile.am
> index e18c681..20ca3cd 100644
> --- a/example/switch/Makefile.am
> +++ b/example/switch/Makefile.am
> @@ -9,7 +9,9 @@ noinst_HEADERS = \
>
>  dist_odp_switch_SOURCES = odp_switch.c
>
> -if HAVE_PCAP
> -TESTS = switch_run.sh
> +if test_example
> +       if HAVE_PCAP
> +               TESTS = switch_run.sh
> +       endif
>  endif
>  EXTRA_DIST = switch_run.sh udp64.pcap
> --
> 2.5.0
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 9665d1d..9acc203 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,6 +141,7 @@  AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
 AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ])
 AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ])
 AM_CONDITIONAL([test_helper], [test x$test_helper = xyes ])
+AM_CONDITIONAL([test_example], [test x$test_example = xyes ])
 AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"])
 AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ])
 AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"])
@@ -243,5 +244,6 @@  AC_MSG_RESULT([
 	test_perf:		${test_perf}
 	test_cpp:		${test_cpp}
 	test_helper:		${test_helper}
+	test_example:		${test_example}
 	user_guides:		${user_guides}
 ])
diff --git a/example/m4/configure.m4 b/example/m4/configure.m4
index 229fed5..11f9fdf 100644
--- a/example/m4/configure.m4
+++ b/example/m4/configure.m4
@@ -3,7 +3,7 @@ 
 ##########################################################################
 test_example=no
 AC_ARG_ENABLE([test-example],
-    [  --enable-test-example       run basic test aginast examples],
+    [  --enable-test-example   run basic test aginast examples],
     [if test "x$enableval" = "xyes"; then
         test_example=yes
      else
diff --git a/example/switch/Makefile.am b/example/switch/Makefile.am
index e18c681..20ca3cd 100644
--- a/example/switch/Makefile.am
+++ b/example/switch/Makefile.am
@@ -9,7 +9,9 @@  noinst_HEADERS = \
 
 dist_odp_switch_SOURCES = odp_switch.c
 
-if HAVE_PCAP
-TESTS = switch_run.sh
+if test_example
+	if HAVE_PCAP
+		TESTS = switch_run.sh
+	endif
 endif
 EXTRA_DIST = switch_run.sh udp64.pcap