Skip to content

Commit 4676077

Browse files
committed
Use GTest for tests
1 parent 4284a9c commit 4676077

File tree

6 files changed

+1414
-1521
lines changed

6 files changed

+1414
-1521
lines changed

cmake/testing.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ function(add_ydb_test)
130130
WORKING_DIRECTORY
131131
${YDB_TEST_WORKING_DIRECTORY}
132132
)
133+
target_link_libraries(${YDB_TEST_NAME} PRIVATE
134+
GTest::gtest_main
135+
)
133136
else()
134137
add_yunittest(
135138
NAME
@@ -146,6 +149,9 @@ function(add_ydb_test)
146149
WORKING_DIRECTORY
147150
${YDB_TEST_WORKING_DIRECTORY}
148151
)
152+
target_link_libraries(${YDB_TEST_NAME} PRIVATE
153+
cpp-testing-unittest_main
154+
)
149155
endif()
150156

151157
set_yunittest_property(

tests/integration/bulk_upsert/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ add_ydb_test(NAME bulk_upsert
22
SOURCES
33
main.cpp
44
bulk_upsert.cpp
5-
bulk_upsert.h
65
LINK_LIBRARIES
76
yutil
87
YDB-CPP-SDK::Table
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
add_ydb_test(NAME server_restart
1+
add_ydb_test(NAME server_restart GTEST
22
SOURCES
33
main.cpp
44
LINK_LIBRARIES
55
yutil
66
api-grpc
77
YDB-CPP-SDK::Query
88
gRPC::grpc++
9-
GTest::gtest_main
109
LABELS
1110
integration
1211
)

tests/unit/client/CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ add_ydb_test(NAME client-ydb_coordination_ut
55
coordination/coordination_ut.cpp
66
LINK_LIBRARIES
77
yutil
8-
cpp-testing-unittest_main
98
YDB-CPP-SDK::Coordination
109
api-grpc
1110
LABELS
@@ -17,7 +16,6 @@ add_ydb_test(NAME client-extensions-discovery_mutator_ut
1716
discovery_mutator/discovery_mutator_ut.cpp
1817
LINK_LIBRARIES
1918
yutil
20-
cpp-testing-unittest_main
2119
YDB-CPP-SDK::DiscoveryMutator
2220
YDB-CPP-SDK::Table
2321
LABELS
@@ -30,7 +28,6 @@ add_ydb_test(NAME client-draft_ut
3028
draft/ydb_view_ut.cpp
3129
LINK_LIBRARIES
3230
yutil
33-
cpp-testing-unittest_main
3431
YDB-CPP-SDK::Draft
3532
LABELS
3633
unit
@@ -45,7 +42,6 @@ add_ydb_test(NAME client-ydb_driver_ut
4542
driver/driver_ut.cpp
4643
LINK_LIBRARIES
4744
yutil
48-
cpp-testing-unittest_main
4945
YDB-CPP-SDK::Driver
5046
YDB-CPP-SDK::Table
5147
LABELS
@@ -71,7 +67,6 @@ add_ydb_test(NAME client-oauth2_ut
7167
oauth2_token_exchange/jwt_token_source_ut.cpp
7268
LINK_LIBRARIES
7369
yutil
74-
cpp-testing-unittest_main
7570
http-server
7671
json
7772
string_utils-base64
@@ -80,12 +75,11 @@ add_ydb_test(NAME client-oauth2_ut
8075
unit
8176
)
8277

83-
add_ydb_test(NAME client-ydb_params_ut
78+
add_ydb_test(NAME client-ydb_params_ut GTEST
8479
SOURCES
8580
params/params_ut.cpp
8681
LINK_LIBRARIES
8782
yutil
88-
cpp-testing-unittest_main
8983
YDB-CPP-SDK::Params
9084
LABELS
9185
unit
@@ -96,19 +90,17 @@ add_ydb_test(NAME client-ydb_result_ut
9690
result/result_ut.cpp
9791
LINK_LIBRARIES
9892
yutil
99-
cpp-testing-unittest_main
10093
YDB-CPP-SDK::Result
10194
YDB-CPP-SDK::Params
10295
LABELS
10396
unit
10497
)
10598

106-
add_ydb_test(NAME client-ydb_value_ut
99+
add_ydb_test(NAME client-ydb_value_ut GTEST
107100
SOURCES
108101
value/value_ut.cpp
109102
LINK_LIBRARIES
110103
yutil
111-
cpp-testing-unittest_main
112104
YDB-CPP-SDK::Value
113105
YDB-CPP-SDK::Params
114106
LABELS

0 commit comments

Comments
 (0)