diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6404c42..acdb482 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Install dependencies for Ubuntu run: | sudo apt-get update - sudo apt-get install --yes help2man qtbase5-dev qttools5-dev qttools5-dev-tools libchewing3-dev lcov + sudo apt-get install --yes help2man qtbase5-dev qttools5-dev qttools5-dev-tools libchewing3-dev lcov libgtest-dev gcc --version g++ --version gcov --version @@ -37,7 +37,7 @@ jobs: run: | # dependencies brew update - brew install libchewing qt@5 + brew install libchewing qt@5 googletest # Allow CMake to find qt@5 by passing down the environment variable echo "CMAKE_PREFIX_PATH=$(brew --prefix qt@5)" >> $GITHUB_ENV diff --git a/CMakeLists.txt b/CMakeLists.txt index ddc5b6f..f345315 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_fla cmake_minimum_required(VERSION 3.10.0...3.31.6) project(chewing-editor VERSION 0.1.2 LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) include(GNUInstallDirs) @@ -65,7 +65,7 @@ else() pkg_check_modules(CHEWING REQUIRED chewing>=0.4.0) endif() -pkg_check_modules(GTEST REQUIRED gtest>=1.7.0) +pkg_check_modules(GTEST REQUIRED gtest>=1.7.0 IMPORTED_TARGET) # Qt library set(CMAKE_AUTOMOC ON) @@ -266,7 +266,7 @@ add_executable(run-test ${run-test_src} ) target_link_libraries(run-test - gtest + PkgConfig::GTEST exporter importer diff --git a/scripts/lcov.sh b/scripts/lcov.sh index a5aa117..b8a5b32 100755 --- a/scripts/lcov.sh +++ b/scripts/lcov.sh @@ -38,7 +38,7 @@ done #echo "ok" ABSPATH=$(cd "$(dirname "$0")/.."; pwd) -lcov --directory $PWD --capture --output-file coverage.info --no-checksum --compat-libtool -lcov --remove coverage.info "/usr/include/*" "$ABSPATH/gmock/*" "$ABSPATH/test/*" --output-file coverage.info +lcov --ignore-errors empty,mismatch --directory $PWD --capture --output-file coverage.info --no-checksum --compat-libtool +lcov --ignore-errors empty,mismatch --remove coverage.info "/usr/include/*" "$ABSPATH/gmock/*" "$ABSPATH/test/*" --output-file coverage.info LANG=C genhtml --prefix $ABSPATH --output-directory coveragereport \ - --title "Code Coverage" --legend --show-details coverage.info + --title "Code Coverage" --legend --ignore-errors empty,mismatch --show-details coverage.info