Skip to content

Commit

Permalink
update imported files
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed May 24, 2024
1 parent ae4c891 commit d88fdcc
Show file tree
Hide file tree
Showing 42 changed files with 330 additions and 314 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux-clang-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
-DCMAKE_C_COMPILER=/usr/bin/clang-18 \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-18 \
-DCODE_COVERAGE:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-GNinja
- name: Build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linux-gcc-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ jobs:
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DBUILD_TESTING:BOOL=ON \
-GNinja
- name: Build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux-gxx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=g++-13 \
-DCMAKE_C_COMPILER=gcc-13 \
-DBUILD_TESTING:BOOL=ON \
-DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake && \
cmake --build build
5 changes: 3 additions & 2 deletions .github/workflows/macos-clang-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Install clang
run: brew install llvm@16 && echo 'export PATH="/opt/homebrew/opt/llvm@16/bin:$PATH"' >> /Users/runner/.bash_profile && source /Users/runner/.bash_profile && which clang++

- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -27,10 +27,11 @@ jobs:
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DBUILD_TESTING:BOOL=ON \
-DCMAKE_CXX_COMPILER=clang++
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- working-directory: build/
- working-directory: build/tests
run: ./faker-cxx-UT
8 changes: 4 additions & 4 deletions .github/workflows/windows-msvc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
- run: cmake -E make_directory build

- working-directory: build/
run: cmake .. -G "Visual Studio 17 2022"
run: cmake .. -G "Visual Studio 17 2022" -DBUILD_TESTING:BOOL=ON

- working-directory: build/
run: cmake --build .
run: cmake --build . --config ${{env.BUILD_TYPE}}

- working-directory: build/
run: ctest -C Debug --output-on-failure
- working-directory: build/tests
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ else ()
target_compile_options(${LIBRARY_NAME} PRIVATE -Wall -Wextra -Wpedantic -Wconversion -Wformat)
endif ()

include(GNUInstallDirs)
install(TARGETS ${LIBRARY_NAME}
EXPORT ${LIBRARY_NAME}-targets
ARCHIVE DESTINATION lib
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt install -y cmake ninja-build g++-13 libstdc++-13-dev

COPY include/ faker-cxx/include/
COPY src/ faker-cxx/src/
COPY tests/ faker-cxx/tests/
COPY externals/ faker-cxx/externals/
COPY cmake/ faker-cxx/cmake/
COPY CMakeLists.txt faker-cxx/CMakeLists.txt
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_tests_linux_gxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ cd build-linux-gxx || exit 1

cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-13 \
-DBUILD_TESTING:BOOL=ON \
-GNinja

cmake --build .

cd tests/ || exit 1

ctest -C Debug --output-on-failure
86 changes: 46 additions & 40 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,64 @@ include("${CMAKE_SOURCE_DIR}/cmake/cmake-coverage.cmake")
add_code_coverage_all_targets()

set(FAKER_UT_SOURCES
src/modules/animal/AnimalTest.cpp
src/modules/book/BookTest.cpp
src/modules/color/ColorTest.cpp
src/modules/commerce/CommerceTest.cpp
src/modules/company/CompanyTest.cpp
src/modules/datatype/DatatypeTest.cpp
src/modules/date/DateTest.cpp
src/modules/finance/FinanceTest.cpp
src/modules/food/FoodTest.cpp
src/modules/internet/InternetTest.cpp
src/modules/location/LocationTest.cpp
src/modules/lorem/LoremTest.cpp
src/modules/number/NumberTest.cpp
src/modules/person/PersonTest.cpp
src/modules/string/StringTest.cpp
src/modules/word/WordTest.cpp
src/common/StringHelperTest.cpp
src/modules/phone/PhoneTest.cpp
src/modules/helper/HelperTest.cpp
src/common/LuhnCheckTest.cpp
src/common/FormatHelperTest.cpp
src/common/mappers/precisionMapper/PrecisionMapperTest.cpp
src/modules/system/SystemTest.cpp
src/modules/database/DatabaseTest.cpp
src/modules/music/MusicTest.cpp
src/modules/movie/MovieTest.cpp
src/modules/git/GitTest.cpp
src/modules/hacker/HackerTest.cpp
src/modules/sport/SportTest.cpp
src/modules/videoGame/VideoGameTest.cpp
src/modules/medicine/MedicineTest.cpp
src/modules/weather/WeatherTest.cpp
src/modules/airline/AirlineTest.cpp
src/modules/image/ImageTest.cpp
src/modules/crypto/CryptoTest.cpp
src/modules/computer/ComputerTest.cpp
src/modules/vehicle/VehicleTest.cpp
src/modules/science/ScienceTest.cpp
src/modules/structure/StructureTest.cpp
common/FormatHelperTest.cpp
common/LuhnCheckTest.cpp
common/mappers/precisionMapper/PrecisionMapperTest.cpp
common/StringHelperTest.cpp
modules/airline/AirlineTest.cpp
modules/animal/AnimalTest.cpp
modules/book/BookTest.cpp
modules/color/ColorTest.cpp
modules/commerce/CommerceTest.cpp
modules/company/CompanyTest.cpp
modules/computer/ComputerTest.cpp
modules/crypto/CryptoTest.cpp
modules/database/DatabaseTest.cpp
modules/datatype/DatatypeTest.cpp
modules/date/DateTest.cpp
modules/finance/FinanceTest.cpp
modules/food/FoodTest.cpp
modules/git/GitTest.cpp
modules/hacker/HackerTest.cpp
modules/helper/HelperTest.cpp
modules/image/ImageTest.cpp
modules/internet/InternetTest.cpp
modules/location/LocationTest.cpp
modules/lorem/LoremTest.cpp
modules/medicine/MedicineTest.cpp
modules/movie/MovieTest.cpp
modules/music/MusicTest.cpp
modules/number/NumberTest.cpp
modules/person/PersonTest.cpp
modules/phone/PhoneTest.cpp
modules/science/ScienceTest.cpp
modules/sport/SportTest.cpp
modules/string/StringTest.cpp
modules/structure/StructureTest.cpp
modules/system/SystemTest.cpp
modules/vehicle/VehicleTest.cpp
modules/videoGame/VideoGameTest.cpp
modules/weather/WeatherTest.cpp
modules/word/WordTest.cpp
)

add_executable(${PROJECT_NAME} ${FAKER_UT_SOURCES})
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /permissive- /bigobj)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/common
${CMAKE_SOURCE_DIR}/src/modules
)

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)
else ()
add_subdirectory(externals/googletest)
add_subdirectory("${CMAKE_SOURCE_DIR}/externals/googletest"
"${CMAKE_BINARY_DIR}/googletest")

set(GTEST_INCLUDE_DIR
"${CMAKE_SOURCE_DIR}/externals/googletest/googletest/include")
Expand Down
4 changes: 2 additions & 2 deletions tests/common/FormatHelperTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "gtest/gtest.h"

#include "src/common/errors/TokenGeneratorNotFoundError.h"
#include "common/errors/TokenGeneratorNotFoundError.h"

using namespace ::testing;
using namespace faker;
Expand Down Expand Up @@ -44,4 +44,4 @@ TEST_F(FormatHelperTest, shouldFormat)
EXPECT_EQ(FormatHelper::format("{}", 1), "1");
EXPECT_EQ(FormatHelper::format("{} {}", "Hello", "World"), "Hello World");
EXPECT_EQ(FormatHelper::format("{0} {1}", "Hello", "World"), "Hello World");
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "PrecisionMapper.h"
#include "common/mappers/precisionMapper/PrecisionMapper.h"

#include "gtest/gtest.h"

Expand Down
10 changes: 5 additions & 5 deletions tests/modules/airline/AirlineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

#include "gtest/gtest.h"

#include "data/AircraftTypes.h"
#include "data/Airlines.h"
#include "data/Airplanes.h"
#include "data/Airports.h"
#include "data/Seat.h"
#include "airline/data/AircraftTypes.h"
#include "airline/data/Airlines.h"
#include "airline/data/Airplanes.h"
#include "airline/data/Airports.h"
#include "airline/data/Seat.h"

using namespace ::testing;
using namespace faker;
Expand Down
30 changes: 15 additions & 15 deletions tests/modules/animal/AnimalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

#include "gtest/gtest.h"

#include "data/Bears.h"
#include "data/Birds.h"
#include "data/Cats.h"
#include "data/Cetaceans.h"
#include "data/Cows.h"
#include "data/Crocodiles.h"
#include "data/Dogs.h"
#include "data/Fishes.h"
#include "data/Horses.h"
#include "data/Insects.h"
#include "data/Lions.h"
#include "data/Rabbits.h"
#include "data/Rodents.h"
#include "data/Snakes.h"
#include "data/Types.h"
#include "animal/data/Bears.h"
#include "animal/data/Birds.h"
#include "animal/data/Cats.h"
#include "animal/data/Cetaceans.h"
#include "animal/data/Cows.h"
#include "animal/data/Crocodiles.h"
#include "animal/data/Dogs.h"
#include "animal/data/Fishes.h"
#include "animal/data/Horses.h"
#include "animal/data/Insects.h"
#include "animal/data/Lions.h"
#include "animal/data/Rabbits.h"
#include "animal/data/Rodents.h"
#include "animal/data/Snakes.h"
#include "animal/data/Types.h"

using namespace ::testing;
using namespace faker;
Expand Down
16 changes: 8 additions & 8 deletions tests/modules/book/BookTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include "gtest/gtest.h"

#include "../../common/StringHelper.h"
#include "data/Authors.h"
#include "data/BookFormat.h"
#include "data/Genres.h"
#include "data/Publishers.h"
#include "data/Series.h"
#include "data/Titles.h"
#include "data/Translators.h"
#include "common/StringHelper.h"
#include "book/data/Authors.h"
#include "book/data/BookFormat.h"
#include "book/data/Genres.h"
#include "book/data/Publishers.h"
#include "book/data/Series.h"
#include "book/data/Titles.h"
#include "book/data/Translators.h"

using namespace ::testing;
using namespace faker;
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/color/ColorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#include "gtest/gtest.h"

#include "../../common/StringHelper.h"
#include "../string/data/Characters.h"
#include "data/Colors.h"
#include "common/StringHelper.h"
#include "string/data/Characters.h"
#include "color/data/Colors.h"

using namespace ::testing;
using namespace faker;
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/commerce/CommerceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include "gtest/gtest.h"

#include "../../common/StringHelper.h"
#include "../string/data/Characters.h"
#include "data/Commerce.h"
#include "common/StringHelper.h"
#include "string/data/Characters.h"
#include "commerce/data/Commerce.h"

using namespace ::testing;
using namespace faker;
Expand Down
26 changes: 13 additions & 13 deletions tests/modules/company/CompanyTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

#include "gtest/gtest.h"

#include "../../common/StringHelper.h"
#include "../person/data/england/EnglishFirstNames.h"
#include "../person/data/england/EnglishLastNames.h"
#include "../person/data/JobTitles.h"
#include "data/BuzzAdjectives.h"
#include "data/BuzzNouns.h"
#include "data/BuzzVerbs.h"
#include "data/CatchPhraseAdjectives.h"
#include "data/CatchPhraseDescriptors.h"
#include "data/CatchPhraseNouns.h"
#include "data/CompanyTypes.h"
#include "data/Industries.h"
#include "data/Suffixes.h"
#include "common/StringHelper.h"
#include "person/data/england/EnglishFirstNames.h"
#include "person/data/england/EnglishLastNames.h"
#include "person/data/JobTitles.h"
#include "company/data/BuzzAdjectives.h"
#include "company/data/BuzzNouns.h"
#include "company/data/BuzzVerbs.h"
#include "company/data/CatchPhraseAdjectives.h"
#include "company/data/CatchPhraseDescriptors.h"
#include "company/data/CatchPhraseNouns.h"
#include "company/data/CompanyTypes.h"
#include "company/data/Industries.h"
#include "company/data/Suffixes.h"

using namespace ::testing;
using namespace faker;
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/computer/ComputerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "gtest/gtest.h"

#include "data/ComputerData.h"
#include "computer/data/ComputerData.h"

using namespace ::testing;
using namespace faker;
Expand Down
10 changes: 5 additions & 5 deletions tests/modules/database/DatabaseTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

#include "gtest/gtest.h"

#include "../string/data/Characters.h"
#include "data/Collations.h"
#include "data/ColumnNames.h"
#include "data/ColumnTypes.h"
#include "data/Engines.h"
#include "string/data/Characters.h"
#include "database/data/Collations.h"
#include "database/data/ColumnNames.h"
#include "database/data/ColumnTypes.h"
#include "database/data/Engines.h"

using namespace ::testing;
using namespace faker;
Expand Down
8 changes: 4 additions & 4 deletions tests/modules/date/DateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#include "gtest/gtest.h"

#include "../../common/StringHelper.h"
#include "data/MonthNames.h"
#include "data/TimeZones.h"
#include "data/WeekdayNames.h"
#include "common/StringHelper.h"
#include "date/data/MonthNames.h"
#include "date/data/TimeZones.h"
#include "date/data/WeekdayNames.h"

#ifdef _WIN32
#define timegm _mkgmtime
Expand Down
Loading

0 comments on commit d88fdcc

Please sign in to comment.