diff mbox

[09/10] configure: move test_vald to its own m4 file

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

Commit Message

Anders Roxell March 23, 2016, 6:37 p.m. UTC
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 configure.ac          | 51 ++-------------------------------------------------
 test/m4/configure.m4  |  1 +
 test/m4/validation.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 49 deletions(-)
 create mode 100644 test/m4/validation.m4
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 1a47e01..1738e73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,17 +123,6 @@  AC_ARG_WITH([testdir],
 AC_SUBST([testdir])
 
 ##########################################################################
-# Enable/disable Unit tests
-##########################################################################
-cunit_support=no
-AC_ARG_ENABLE([cunit_support],
-    [  --enable-cunit-support  include cunit infrastructure],
-    [if test x$enableval = xyes; then
-        cunit_support=yes
-    fi])
-
-
-##########################################################################
 # Set conditionals as computed within platform specific files
 ##########################################################################
 AM_CONDITIONAL([dpdk_support], [test x$dpdk_support = xyes ])
@@ -141,6 +130,8 @@  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_installdir], [test "$testdir" != ""])
+AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
+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 ])
@@ -155,29 +146,6 @@  DX_HTML_FEATURE(ON)
 DX_PDF_FEATURE(OFF)
 DX_PS_FEATURE(OFF)
 DX_INIT_DOXYGEN($PACKAGE_NAME, ${srcdir}/doc/application-api-guide/doxygen.cfg, ${builddir}/doc/application-api-guide/output)
-##########################################################################
-# Enable/disable Unit tests
-##########################################################################
-test_vald=no
-AC_ARG_ENABLE([test_vald],
-    [  --enable-test-vald       run test in test/validation],
-    [if test x$enableval = xyes; then
-        test_vald=yes
-        cunit_support=yes
-    fi])
-
-AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
-
-##########################################################################
-# Set optional CUnit path
-##########################################################################
-AC_ARG_WITH([cunit-path],
-AC_HELP_STRING([--with-cunit-path=DIR   path to CUnit libs and headers],
-               [(or in the default path if not specified).]),
-    [CUNIT_PATH=$withval
-    AM_CPPFLAGS="$AM_CPPFLAGS -I$CUNIT_PATH/include"
-    AM_LDFLAGS="$AM_LDFLAGS -L$CUNIT_PATH/lib"
-    cunit_support=yes],[])
 
 ##########################################################################
 # Enable/disable ODP_DEBUG_PRINT
@@ -210,21 +178,6 @@  LDFLAGS="$AM_LDFLAGS $LDFLAGS"
 CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
 
 ##########################################################################
-# Check for CUnit availability
-##########################################################################
-if test x$cunit_support = xyes
-then
-    AC_CHECK_LIB([cunit],[CU_get_error], [],
-        [AC_MSG_ERROR([CUnit libraries required])])
-    AC_CHECK_HEADERS([CUnit/Basic.h], [],
-        [AC_MSG_FAILURE(["can't find cunit headers"])])
-else
-    cunit_support=no
-fi
-
-AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
-
-##########################################################################
 # Restore old saved variables
 ##########################################################################
 LDFLAGS=$OLD_LDFLAGS
diff --git a/test/m4/configure.m4 b/test/m4/configure.m4
index 4e16b82..e5b291a 100644
--- a/test/m4/configure.m4
+++ b/test/m4/configure.m4
@@ -1,5 +1,6 @@ 
 m4_include([test/m4/miscellaneous.m4])
 m4_include([test/m4/performance.m4])
+m4_include([test/m4/validation.m4])
 
 AC_CONFIG_FILES([test/Makefile
 		 test/miscellaneous/Makefile
diff --git a/test/m4/validation.m4 b/test/m4/validation.m4
new file mode 100644
index 0000000..b137118
--- /dev/null
+++ b/test/m4/validation.m4
@@ -0,0 +1,44 @@ 
+##########################################################################
+# Enable/disable Unit tests
+##########################################################################
+cunit_support=no
+test_vald=no
+AC_ARG_ENABLE([test_vald],
+    [  --enable-test-vald       run test in test/validation],
+    [if test x$enableval = xyes; then
+        test_vald=yes
+        cunit_support=yes
+    fi])
+
+##########################################################################
+# Enable/disable Unit tests
+##########################################################################
+AC_ARG_ENABLE([cunit_support],
+    [  --enable-cunit-support  include cunit infrastructure],
+    [if test x$enableval = xyes; then
+        cunit_support=yes
+    fi])
+
+##########################################################################
+# Set optional CUnit path
+##########################################################################
+AC_ARG_WITH([cunit-path],
+AC_HELP_STRING([--with-cunit-path=DIR   path to CUnit libs and headers],
+               [(or in the default path if not specified).]),
+    [CUNIT_PATH=$withval
+    AM_CPPFLAGS="$AM_CPPFLAGS -I$CUNIT_PATH/include"
+    AM_LDFLAGS="$AM_LDFLAGS -L$CUNIT_PATH/lib"
+    cunit_support=yes],[])
+
+##########################################################################
+# Check for CUnit availability
+##########################################################################
+if test x$cunit_support = xyes
+then
+    AC_CHECK_LIB([cunit],[CU_get_error], [],
+        [AC_MSG_ERROR([CUnit libraries required])])
+    AC_CHECK_HEADERS([CUnit/Basic.h], [],
+        [AC_MSG_FAILURE(["can't find cunit headers"])])
+else
+    cunit_support=no
+fi