Skip to content

Commit

Permalink
fix: fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal committed Jun 29, 2024
1 parent e18ad28 commit 3687d81
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 42 deletions.
74 changes: 37 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,43 @@ if (BUILD_TESTING)
endif ()

set(FAKER_SOURCES
src/modules/airline/Airline.cpp
src/modules/animal/Animal.cpp
src/modules/book/Book.cpp
src/modules/color/Color.cpp
src/modules/commerce/Commerce.cpp
src/modules/company/Company.cpp
src/modules/computer/Computer.cpp
src/modules/crypto/Crypto.cpp
src/modules/database/Database.cpp
src/modules/datatype/Datatype.cpp
src/modules/date/Date.cpp
src/modules/finance/Finance.cpp
src/modules/food/Food.cpp
src/modules/git/Git.cpp
src/modules/hacker/Hacker.cpp
src/modules/helper/Helper.cpp
src/modules/image/Image.cpp
src/modules/internet/Internet.cpp
src/modules/location/Location.cpp
src/modules/lorem/Lorem.cpp
src/modules/medicine/Medicine.cpp
src/modules/movie/Movie.cpp
src/modules/music/Music.cpp
src/modules/person/Person.cpp
src/modules/phone/Phone.cpp
src/modules/plant/Plant.cpp
src/modules/science/Science.cpp
src/modules/sport/Sport.cpp
src/modules/string/String.cpp
src/modules/system/System.cpp
src/modules/vehicle/Vehicle.cpp
src/modules/videoGame/VideoGame.cpp
src/modules/weather/Weather.cpp
src/modules/word/Word.cpp
src/common/FormatHelper.cpp
src/common/LuhnCheck.cpp
src/common/StringHelper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/airline/Airline.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/animal/Animal.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/book/Book.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/color/Color.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/commerce/Commerce.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/company/Company.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/computer/Computer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/crypto/Crypto.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/database/Database.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/datatype/Datatype.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/date/Date.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/finance/Finance.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/food/Food.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/git/Git.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/hacker/Hacker.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/helper/Helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/image/Image.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/internet/Internet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/location/Location.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/lorem/Lorem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/medicine/Medicine.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/movie/Movie.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/music/Music.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/person/Person.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/phone/Phone.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/plant/Plant.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/science/Science.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/sport/Sport.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/string/String.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/system/System.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/vehicle/Vehicle.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/videoGame/VideoGame.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/weather/Weather.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/word/Word.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/FormatHelper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/LuhnCheck.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/common/StringHelper.cpp
)

add_library(${CMAKE_PROJECT_NAME} ${FAKER_SOURCES})
Expand Down
15 changes: 10 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.22)
project(${CMAKE_PROJECT_NAME}-UT CXX)
project(${CMAKE_PROJECT_NAME}-UT LANGUAGES CXX)

include(CTest)
include("${CMAKE_SOURCE_DIR}/cmake/CompilerWarnings.cmake")
Expand Down Expand Up @@ -45,29 +45,34 @@ set(FAKER_UT_SOURCES
modules/word/WordTest.cpp
)

add_executable(${PROJECT_NAME} ${FAKER_UT_SOURCES})
add_executable(${PROJECT_NAME} ${FAKER_UT_SOURCES} ${FAKER_SOURCES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)

configure_compiler_warnings(${PROJECT_NAME}
"${WARNINGS_AS_ERRORS}"
"${MSVC_WARNINGS}"
"${CLANG_WARNINGS}"
"${GCC_WARNINGS}")

target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/common
${CMAKE_SOURCE_DIR}/src/modules
${CMAKE_BINARY_DIR}/include
)

if (USE_SYSTEM_DEPENDENCIES)
find_package(GTest REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main faker-cxx)
target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main)
else ()
add_subdirectory("${CMAKE_SOURCE_DIR}/externals/googletest" "${CMAKE_BINARY_DIR}/googletest")

set(GTEST_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/googletest/googletest/include")
set(GMOCK_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/googletest/googlemock/include")

target_link_libraries(${PROJECT_NAME} PRIVATE gtest_main gmock_main faker-cxx)
target_link_libraries(${PROJECT_NAME} PRIVATE gtest_main gmock_main)
endif ()

if (HAS_STD_FORMAT)
Expand All @@ -80,6 +85,6 @@ endif ()

add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
set_tests_properties(${PROJECT_NAME} PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<$<BOOL:${WIN32}>:$<TARGET_FILE_DIR:faker-cxx>>")
"PATH=path_list_prepend:$<$<BOOL:${WIN32}>:$<TARGET_FILE_DIR:faker-cxx>>")

target_code_coverage(${PROJECT_NAME} ALL)

0 comments on commit 3687d81

Please sign in to comment.