-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
96 lines (78 loc) · 2.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
cmake_minimum_required(VERSION 3.14)
project(algo_baselines)
set(CMAKE_CXX_STANDARD 17)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)
include_directories(include)
enable_testing()
## Datastructures
add_executable(data_structures_tests
test/data_structures/main.cc
test/data_structures/binary_search_tree_test.cc
test/data_structures/sparse_table_test.cc
test/data_structures/queue_test.cc
test/data_structures/quick_union_test.cc
)
target_link_libraries(data_structures_tests gtest)
gtest_discover_tests(data_structures_tests)
## Dynamic Programming
add_executable(dynamic_programming_tests
test/dynamic_programming/mountain_scenes_test.cc
test/dynamic_programming/narrow_art_gallery_test.cc
test/dynamic_programming/knapsack_test.cc
test/dynamic_programming/main.cc
)
target_link_libraries(dynamic_programming_tests gtest)
gtest_discover_tests(dynamic_programming_tests)
## Graphs
add_executable(graph_tests
test/graph/main.cc
test/graph/mutation_test.cc
test/graph/shortest_path_test.cc
test/graph/topological_sort_test.cc
test/graph/traversal_test.cc
)
target_link_libraries(graph_tests gtest)
gtest_discover_tests(graph_tests)
## Lists
add_executable(list_tests
test/list/main.cc
test/list/reverse_list_test.cc
)
target_link_libraries(list_tests gtest)
gtest_discover_tests(list_tests)
## Search
add_executable(search_tests
test/search/main.cc
test/search/binary_search_test.cc
test/search/range_contains_test.cc
test/search/quick_select_test.cc
test/search/search_pattern_kmp_test.cc
test/search/search_smaller_value_test.cc
)
target_link_libraries(search_tests gtest)
gtest_discover_tests(search_tests)
## Sort
add_executable(sort_tests
test/sort/main.cc
test/sort/merge_sort_test.cc
test/sort/general_sort_test.cc
)
target_link_libraries(sort_tests gtest)
gtest_discover_tests(sort_tests)
## Trees
add_executable(tree_tests
test/tree/main.cc
test/tree/find_center_test.cc
test/tree/hash_tree_test.cc
test/tree/is_isomorphic_test.cc
test/tree/lowest_common_ancestor_test.cc
test/tree/root_tree_test.cc
)
target_link_libraries(tree_tests gtest)
gtest_discover_tests(tree_tests)