From: Ilho Kim Date: Wed, 29 Jul 2020 04:59:19 +0000 (+0900) Subject: Change to use gmock package instead of gtest X-Git-Tag: accepted/tizen/6.0/unified/20201030.120134~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7da27104fc9d02aacce38235d41be64dcaa9469e;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Change to use gmock package instead of gtest Change-Id: I33cbd009e6209665241dd1ceb457efbfa7bd56d9 Signed-off-by: Ilho Kim --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 29f3588..b39ba87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,9 @@ PKG_CHECK_MODULES(ENCRYPTION_DEPS REQUIRED libwebappenc) PKG_CHECK_MODULES(TPK_INSTALLER_DEPS REQUIRED tpk-installer) PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf) PKG_CHECK_MODULES(GUM_DEPS REQUIRED libgum) +PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock) FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options) -FIND_PACKAGE(GTest REQUIRED) ADD_SUBDIRECTORY(data) ADD_SUBDIRECTORY(src) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index dba4863..3ae7328 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -13,7 +13,6 @@ Source1002: wgt-installer-tests.manifest Requires: wgt-installer = %{version} BuildRequires: boost-devel BuildRequires: cmake -BuildRequires: gtest-devel BuildRequires: app-installers-tests BuildRequires: pkgconfig(app-installers) BuildRequires: pkgconfig(manifest-parser) @@ -24,6 +23,7 @@ BuildRequires: pkgconfig(libwebappenc) BuildRequires: pkgconfig(tpk-installer) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(libgum) +BuildRequires: pkgconfig(gmock) %description This is a package that installs the WGT backend of pkgmgr. diff --git a/test/smoke_tests/CMakeLists.txt b/test/smoke_tests/CMakeLists.txt index b64f353..d89b996 100644 --- a/test/smoke_tests/CMakeLists.txt +++ b/test/smoke_tests/CMakeLists.txt @@ -28,17 +28,17 @@ INSTALL(DIRECTORY test_samples/ DESTINATION ${SHAREDIR}/${DESTINATION_DIR}/test_ APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST} PUBLIC Boost - GTEST + GMOCK_DEPS GUM_DEPS ) APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST_EXTENSIVE} PUBLIC Boost - GTEST + GMOCK_DEPS GUM_DEPS ) APPLY_PKG_CONFIG(${TARGET_MANIFEST_TEST} PUBLIC Boost - GTEST + GMOCK_DEPS ) # FindGTest module do not sets all needed libraries in GTEST_LIBRARIES and diff --git a/test/smoke_tests/manifest_test.cc b/test/smoke_tests/manifest_test.cc index 56549d0..a66b478 100644 --- a/test/smoke_tests/manifest_test.cc +++ b/test/smoke_tests/manifest_test.cc @@ -772,3 +772,22 @@ TEST_F(ManifestTest, CategoryElement_MultipleElements) { ASSERT_CSTR_EQ(categories[2].c_str(), "http://tizen.org/category/category_2"); } + +int main(int argc, char** argv) { + int ret = -1; + try { + testing::InitGoogleTest(&argc, argv); + } catch(...) { + std::cout << "Exception occurred" << std::endl; + } + + try { + ret = RUN_ALL_TESTS(); + } catch (const ::testing::internal::GoogleTestFailureException& e) { + ret = -1; + std::cout << "GoogleTestFailureException was thrown:" << e.what() + << std::endl; + } + + return ret; +} diff --git a/test/smoke_tests/smoke_test.cc b/test/smoke_tests/smoke_test.cc index fc49bf4..883f3a2 100644 --- a/test/smoke_tests/smoke_test.cc +++ b/test/smoke_tests/smoke_test.cc @@ -879,7 +879,7 @@ TEST_F(SmokeTest, RecoveryMode_CrashAfterUnzip) { ASSERT_FALSE(recovery_file.empty()); std::unique_ptr recovery_info = GetRecoverFileInfo(recovery_file); - ASSERT_TRUE(recovery_info); + ASSERT_TRUE(recovery_info ? true : false); ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));