Skip to content

Commit

Permalink
IMPR: Improve linking between the code parts
Browse files Browse the repository at this point in the history
Improve linking between the code parts

Plus, Ignore the 'modernize-type-traits' checker warning
Plus, Ignore clang-format in 1 place
Plus, Update version of 'actions/download-artifact' and
 'actions/upload-artifact'
  • Loading branch information
slali87 authored Jul 19, 2024
1 parent cfdbfc7 commit 724252b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
./run.sh complex
- name: Upload artifacts
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
Expand All @@ -130,7 +130,7 @@ jobs:
run: |
git clone --depth 1 --single-branch --branch gh-pages --no-tags https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}.git
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: .
Expand Down
5 changes: 2 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_directories(../incl)

add_library (${CMAKE_PROJECT_NAME}InnerLib App.h App.cpp)
target_link_libraries (${CMAKE_PROJECT_NAME}InnerLib PRIVATE ${CMAKE_PROJECT_NAME}Lib)
add_executable (${CMAKE_PROJECT_NAME} main.cpp)
target_link_libraries (${CMAKE_PROJECT_NAME} ${CMAKE_PROJECT_NAME}InnerLib ${CMAKE_PROJECT_NAME}Lib)
target_link_libraries (${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_PROJECT_NAME}InnerLib)
3 changes: 1 addition & 2 deletions src_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include_directories(../incl)

add_library (${CMAKE_PROJECT_NAME}Lib ../incl/Lib.h Lib.cpp ../incl/IHelloWorld.h ../incl/HelloWorld.h HelloWorld.cpp)
target_include_directories(${CMAKE_PROJECT_NAME}Lib PUBLIC ../incl)
7 changes: 4 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
include_directories(../incl)

include_directories(../src)
include_directories(../../../Deps/googletest/googletest/include)
include_directories(../../../Deps/googletest/googlemock/include)

add_executable (${CMAKE_PROJECT_NAME}Test main.cpp LibTestCases.cpp AppTestCases.cpp)
find_library(GTest gtest HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../../../Deps/googletest/build/lib/)
find_library(GMock gmock HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../../../Deps/googletest/build/lib/)
if(UNIX)
set(PThreadLib -pthread)
else()
set(StaticLink -static)
endif()
target_link_libraries(${CMAKE_PROJECT_NAME}Test PUBLIC ${CMAKE_PROJECT_NAME}Lib ${CMAKE_PROJECT_NAME}InnerLib ${PThreadLib} ${StaticLink} ${GTest} ${GMock})

add_executable (${CMAKE_PROJECT_NAME}Test MockHelloWorld.h main.cpp LibTestCases.cpp AppTestCases.cpp)
target_link_libraries(${CMAKE_PROJECT_NAME}Test PRIVATE ${CMAKE_PROJECT_NAME}Lib ${CMAKE_PROJECT_NAME}InnerLib ${PThreadLib} ${StaticLink} ${GTest} ${GMock})

add_test(NAME ${CMAKE_PROJECT_NAME}Test COMMAND ${CMAKE_PROJECT_NAME}Test)
3 changes: 2 additions & 1 deletion test/MockHelloWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
class MockHelloWorld : public IHelloWorld {
public:
// NOLINTNEXTLINE(misc-non-private-member-variables-in-classes)
// clang-format off
// NOLINTNEXTLINE(misc-non-private-member-variables-in-classes, modernize-type-traits) // clang-format on
MOCK_METHOD(const char*, hello, (), (const, override));
};

0 comments on commit 724252b

Please sign in to comment.