diff mbox series

[v1,1/1] configure: "best effort" approach for CUnit and validation tests

Message ID 1505840409-31804-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/1] configure: "best effort" approach for CUnit and validation tests | expand

Commit Message

Github ODP bot Sept. 19, 2017, 5 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Allow configure to succeed (by disabling validation testsuite), if CUnit
library was not found or if user did not specify --enable-test-vald
explicitly).

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

---
/** Email created from pull request 183 (lumag:fix-cunit)
 ** https://github.com/Linaro/odp/pull/183
 ** Patch: https://github.com/Linaro/odp/pull/183.patch
 ** Base sha: e1c46f8e296a730ed27141a33189185bb7dfd1b1
 ** Merge commit sha: 90dc2a2f23d0bfde192756bd2e73e247e7fed511
 **/
 configure.ac                      |  1 -
 test/common_plat/m4/validation.m4 | 24 ++++++++++++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 4af2c7c72..f7da75ec4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,7 +214,6 @@  AM_CONDITIONAL([test_installdir], [test "x$testdir" != "xno"])
 # Set conditionals as computed within platform specific files
 ##########################################################################
 AM_CONDITIONAL([SDK_INSTALL_PATH_], [test "x${SDK_INSTALL_PATH_}" = "x1"])
-AM_CONDITIONAL([cunit_support], [test x$cunit_support = 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"])
diff --git a/test/common_plat/m4/validation.m4 b/test/common_plat/m4/validation.m4
index 78c4ec03a..bf849aa3f 100644
--- a/test/common_plat/m4/validation.m4
+++ b/test/common_plat/m4/validation.m4
@@ -4,21 +4,29 @@ 
 AC_ARG_ENABLE([test_vald],
     [AS_HELP_STRING([--enable-test-vald], [run test in test/validation])],
     [test_vald=$enableval],
-    [test_vald=yes])
-AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
+    [test_vald=check])
 
 ##########################################################################
 # Check for CUnit availability
 ##########################################################################
 cunit_support=$test_vald
-AS_IF([test "x$cunit_support" = "xyes"],
-      [PKG_CHECK_MODULES([CUNIT], [cunit], [],
+AS_IF([test "x$cunit_support" != "xno"],
+      [PKG_CHECK_MODULES([CUNIT], [cunit], [cunit_support=yes],
       [AC_MSG_WARN([pkg-config could not find CUnit, guessing])
-    AC_CHECK_HEADERS([CUnit/Basic.h], [],
-        [AC_MSG_ERROR(["can't find CUnit headers"])])
-    AC_CHECK_LIB([cunit],[CU_get_error], [CUNIT_LIBS="-lcunit"],
-        [AC_MSG_ERROR([CUnit libraries required])])
+    cunit_support=yes
+    AC_CHECK_HEADERS([CUnit/Basic.h], [], [cunit_support=no])
+    AC_CHECK_LIB([cunit], [CU_get_error], [CUNIT_LIBS="-lcunit"],
+		 [cunit_support=no])
 ])])
 
+AS_IF([test "x$test_vald" = "xyes" -a "x$cunit_support" = "xno"],
+      [AC_MSG_ERROR([Validation testsuite requested, but CUnit was not found])],
+      [test "x$test_vald" = "xcheck" -a "x$cunit_support" = "xno"],
+      [AC_MSG_WARN([CUnit was not found, disabling validation testsuite])
+       test_vald=no])
+
+AM_CONDITIONAL([cunit_support], [test "x$cunit_support" = "xyes"])
+AM_CONDITIONAL([test_vald], [test "x$test_vald" = "xyes"])
+
 AC_SUBST([CUNIT_CFLAGS])
 AC_SUBST([CUNIT_LIBS])