File tree Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
66set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
77
88
9- # .clang-tidy settp
9+ # .clang-tidy setup
1010find_program (CLANG_TIDY_EXE NAMES "clang-tidy" )
1111if (CLANG_TIDY_EXE)
1212 message (STATUS "clang-tidy found: ${CLANG_TIDY_EXE} " )
Original file line number Diff line number Diff line change @@ -13,22 +13,19 @@ FetchContent_MakeAvailable(googletest)
1313enable_testing ()
1414
1515add_executable (
16- 0001-Basics-Tests
16+ 0001BasicsTests
1717 NodeTest.cc)
1818
1919target_link_libraries (
20- 0001-Basics-Tests
20+ 0001BasicsTests
2121 GTest::gtest_main
22- )
23-
24- target_link_libraries (
25- 0001-Basics-Tests
2622 0001BASICS
2723)
2824
25+ # Add .clang-tidy configuration to this library.
2926if (CLANG_TIDY_EXE)
3027 set_target_properties (0001BASICS PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND} " )
3128endif ()
3229
3330include (GoogleTest)
34- gtest_discover_tests(0001-Basics-Tests DISCOVERY_TIMEOUT 30)
31+ gtest_discover_tests(0001BasicsTests DISCOVERY_TIMEOUT 30)
Original file line number Diff line number Diff line change @@ -5,22 +5,28 @@ FetchContent_Declare(
55 googletest
66 URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
77)
8+
89# For Windows: Prevent overriding the parent project's compiler/linker settings
910set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
1011FetchContent_MakeAvailable(googletest)
1112
12-
1313enable_testing ()
1414
1515add_executable (
1616 0002TreeTests
17- 0001_BinarySearchTreeTest.cc)
17+ 0001_BinarySearchTreeTest.cc
18+ )
1819
1920target_link_libraries (
2021 0002TreeTests
2122 GTest::gtest_main
2223 0002TREE
2324)
2425
26+ # Add .clang-tidy configuration to this library.
27+ if (CLANG_TIDY_EXE)
28+ set_target_properties (0002TREE PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND} " )
29+ endif ()
30+
2531include (GoogleTest)
2632gtest_discover_tests(0002TreeTests DISCOVERY_TIMEOUT 30)
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ FetchContent_Declare(
55 googletest
66 URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
77)
8+
89# For Windows: Prevent overriding the parent project's compiler/linker settings
910set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
1011FetchContent_MakeAvailable(googletest)
1112
12-
1313enable_testing ()
1414
1515add_executable (
@@ -41,5 +41,10 @@ target_link_libraries(
4141 0003GRAPH
4242)
4343
44+ # Add .clang-tidy configuration to this library.
45+ if (CLANG_TIDY_EXE)
46+ set_target_properties (0003GRAPH PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND} " )
47+ endif ()
48+
4449include (GoogleTest)
4550gtest_discover_tests(0003GraphTests DISCOVERY_TIMEOUT 30)
You can’t perform that action at this time.
0 commit comments