From: SooChan Lim Date: Tue, 31 Dec 2019 01:11:48 +0000 (+0900) Subject: use gmock intead of gtest X-Git-Tag: accepted/tizen/unified/20200415.121412~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Flibtbm.git;a=commitdiff_plain;h=7a15326ccb3d3d055926dc9802f87821b49fead2 use gmock intead of gtest The gmock conflict with gtest and gmock contains gtest. Therefore, haltests uses gmock intead of gtest to use gmock. Change-Id: I3166caa1991fd38499b816a1cec9d42dc4f2604f --- diff --git a/configure.ac b/configure.ac index c19d3a7..9c3ac2f 100644 --- a/configure.ac +++ b/configure.ac @@ -81,10 +81,14 @@ PKG_CHECK_MODULES(WL_SERVER, wayland-server) PKG_CHECK_MODULES(WL_SCANNER, wayland-scanner) PKG_CHECK_MODULES(LIBPNG, libpng) PKG_CHECK_MODULES(LIBPIXMAN, pixman-1) +PKG_CHECK_MODULES(GMOCK, gmock) LIBTBM_CFLAGS+="$LIBTBM_CFALGS $LIBDRM_CFLAGS $CAPI_CFLAGS $WL_CLIENT_CFLAGS $WL_SERVER_CFLAGS $LIBPNG_CFLAGS $LIBPIXMAN_CFLAGS " LIBTBM_LIBS+="$LIBTBM_LIBS $LIBDRM_LIBS $CAPI_LIBS $WL_CLIENT_LIBS $WL_SERVER_LIBS $LIBPNG_LIBS $LIBPIXMAN_LIBS " +LIBTBM_TEST_CFLAGS="$GMOCK_CLAGS" +LIBTBM_TEST_LIBS="$GMOCK_LIBS" + PKG_CHECK_EXISTS([dlog], [have_dlog="yes"], [have_dlog="no"]) AC_MSG_CHECKING([Have dlog logger]) AC_MSG_RESULT([${have_dlog}]) @@ -99,6 +103,8 @@ fi AC_SUBST(LIBTBM_CFLAGS) AC_SUBST(LIBTBM_LIBS) +AC_SUBST(LIBTBM_TEST_CFLAGS) +AC_SUBST(LIBTBM_TEST_LIBS) HOST_CPU_X86_64=no case $host_cpu in diff --git a/haltests/Makefile.am b/haltests/Makefile.am index ae5d033..d688902 100644 --- a/haltests/Makefile.am +++ b/haltests/Makefile.am @@ -14,15 +14,17 @@ tbm_haltests_SOURCES = \ tbm_haltests_CXXFLAGS = \ @DLOG_CFLAGS@ \ ${CXXFLAGS} \ + @LIBTBM_CFLAGS@ \ + @LIBTBM_TEST_CFLAGS@ \ -I$(top_builddir)/include \ - -I$(top_builddir)/src \ - -I$(includedir)/gtest + -I$(top_builddir)/src tbm_haltests_LDFLAGS = \ @DLOG_LIBS@ \ + @LIBTBM_LIBS@ \ + @LIBTBM_TEST_LIBS@ \ ${LDFLAGS} \ $(top_builddir)/src/libtbm.la \ - -lgtest \ -pthread check: diff --git a/haltests/tc_main.cpp b/haltests/tc_main.cpp index a936217..7545995 100644 --- a/haltests/tc_main.cpp +++ b/haltests/tc_main.cpp @@ -28,7 +28,7 @@ * **************************************************************************/ -#include "gtest/gtest.h" +#include "gmock/gmock.h" #ifdef TIZEN_TEST_GCOV extern "C" void __gcov_flush(void); @@ -43,7 +43,7 @@ int main(int argc, char **argv) #endif try { - ::testing::InitGoogleTest(&argc, argv); + ::testing::InitGoogleMock(&argc, argv); ::testing::FLAGS_gtest_death_test_style = "fast"; } catch ( ... ) { std::cout << "error while trying to init google tests.\n"; diff --git a/haltests/tc_tbm.h b/haltests/tc_tbm.h index 7393f8d..801847e 100644 --- a/haltests/tc_tbm.h +++ b/haltests/tc_tbm.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -91,7 +91,7 @@ using ::testing::Bool; using ::testing::Values; using ::testing::Combine; -class TBMEnv : public TestWithParam< ::testing::tuple > +class TBMEnv : public TestWithParam< std::tuple > { public: void SetUp(void); diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec index 41613bd..dfbe95b 100644 --- a/packaging/libtbm.spec +++ b/packaging/libtbm.spec @@ -23,7 +23,7 @@ BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(pixman-1) -BuildRequires: gtest-devel +BuildRequires: pkgconfig(gmock) %description Description: %{summary}