From b234aedb596d07cb1a1a679cfac68d76e1ae1fe4 Mon Sep 17 00:00:00 2001 From: Erez Geva Date: Thu, 10 Oct 2024 11:15:46 +0200 Subject: [PATCH] Probe Google test mock header. Signed-off-by: Erez Geva --- configure.ac | 4 ++++ defs.mk.in | 1 + tools/ci_address.sh | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 371a7621..3d0eb53f 100644 --- a/configure.ac +++ b/configure.ac @@ -339,6 +339,7 @@ AS_UNSET([ptpm_skip_libsys]) AS_UNSET([HAVE_GTEST_HEADER]) AS_UNSET([GTEST_INC_FLAGS]) AS_UNSET([GTEST_LIB_FLAGS]) +AS_UNSET([HAVE_GMOCK_HEADER]) AS_UNSET([HAVE_CRITERION_HEADER]) AS_UNSET([CRITERION_INC_FLAGS]) AS_UNSET([CRITERION_LIB_FLAGS]) @@ -361,6 +362,8 @@ AS_IF([PTPM_VAR_SET_TEST([HAVE_GTEST_HEADER]) &&\ ['-lgtest -lpthread'])])], [AS_UNSET([GTEST_LIB_FLAGS])], ["$GTEST_LIB_FLAGS"])]) +AC_CHECK_HEADER([gmock/gmock.h], + [AS_VAR_SET([HAVE_GMOCK_HEADER], ['gmock/gmock.h'])]) AC_CHECK_HEADER([criterion/criterion.h], [AS_VAR_SET([HAVE_CRITERION_HEADER], ['criterion/criterion.h'])]) @@ -388,6 +391,7 @@ AS_VAR_IF([ptpm_skip_libsys], ['no'], AC_SUBST([HAVE_GTEST_HEADER]) AC_SUBST([GTEST_INC_FLAGS]) AC_SUBST([GTEST_LIB_FLAGS]) +AC_SUBST([HAVE_GMOCK_HEADER]) AC_SUBST([HAVE_CRITERION_HEADER]) AC_SUBST([CRITERION_INC_FLAGS]) AC_SUBST([CRITERION_LIB_FLAGS]) diff --git a/defs.mk.in b/defs.mk.in index 74d70d80..6d657112 100644 --- a/defs.mk.in +++ b/defs.mk.in @@ -103,6 +103,7 @@ DATE:=@DATE@ HAVE_GTEST_HEADER:=@HAVE_GTEST_HEADER@ GTEST_INC_FLAGS:=@GTEST_INC_FLAGS@ GTEST_LIB_FLAGS:=@GTEST_LIB_FLAGS@ +HAVE_GMOCK_HEADER:=@HAVE_GMOCK_HEADER@ HAVE_CRITERION_HEADER:=@HAVE_CRITERION_HEADER@ CRITERION_INC_FLAGS:=@CRITERION_INC_FLAGS@ CRITERION_LIB_FLAGS:=@CRITERION_LIB_FLAGS@ diff --git a/tools/ci_address.sh b/tools/ci_address.sh index a2aee1aa..056de129 100755 --- a/tools/ci_address.sh +++ b/tools/ci_address.sh @@ -392,7 +392,7 @@ config_report() local list='build host TCL_MINVER PERL PY3_VER RUBY_VER PHP_VER LUA_VERS LUA_VER USE_ENDIAN PERL5_VER GO_MINVER DOTTOOL ASTYLE_MINVER HAVE_GTEST_HEADER HAVE_CRITERION_HEADER - CPPCHECK SWIG_MINVER DOXYGEN_MINVER + HAVE_GMOCK_HEADER CPPCHECK SWIG_MINVER DOXYGEN_MINVER PACKAGE_VERSION CXX_VERSION CXX CC_VERSION CC CHRPATH PATCHELF HAVE_SSL_HEADER HAVE_GCRYPT_HEADER HAVE_GNUTLS_HEADER HAVE_NETTLE_HEADER' local langs='tcl perl5 python3 ruby php lua go' @@ -436,6 +436,7 @@ config_report() [[ -n "$HAVE_GNUTLS_HEADER" ]] && local -r gnutls='v' || local -r gnutls='x' [[ -n "$HAVE_NETTLE_HEADER" ]] && local -r nettle='v' || local -r nettle='x' [[ -n "$HAVE_GTEST_HEADER" ]] && local -r gtest='v' || local -r gtest='x' + [[ -n "$HAVE_GMOCK_HEADER" ]] && local -r gmock='v' || local -r gmock='x' [[ -n "$HAVE_CRITERION_HEADER" ]] && local -r crtest='v' || local -r crtest='x' [[ -n "$CPPCHECK" ]] && local -r cppcheck='v' || local -r cppcheck='x' [[ -n "$SWIG_MINVER" ]] && local -r swig="$SWIG_MINVER" || local -r swig='x' @@ -447,7 +448,7 @@ compilers $CXX $CXX_VERSION, $CC $CC_VERSION rpath '$rpath' ssl '$ssl' gcrypt '$gcrypt' gnutls '$gnutls' nettle '$nettle' Doxygen '$doxy' dot '$dver' cppcheck '$cppcheck' astyle '$astyle' -Google test '$gtest' Criterion test '$crtest' +Google test '$gtest' Google test mock '$gmock' Criterion test '$crtest' swig '$swig' Python '$python3' Ruby '$ruby' PHP '$php' Perl '$perl5' go '$go' tcl '$tcl' Lua '$lua' ============================================================