Skip to content

Commit a7226d1

Browse files
committed
Use GTest for tests
1 parent a99bf35 commit a7226d1

File tree

6 files changed

+1414
-1520
lines changed

6 files changed

+1414
-1520
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 & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ add_ydb_test(NAME client-ydb_coordination_ut
33
coordination/coordination_ut.cpp
44
LINK_LIBRARIES
55
yutil
6-
cpp-testing-unittest_main
76
YDB-CPP-SDK::Coordination
87
api-grpc
98
LABELS
@@ -15,7 +14,6 @@ add_ydb_test(NAME client-extensions-discovery_mutator_ut
1514
discovery_mutator/discovery_mutator_ut.cpp
1615
LINK_LIBRARIES
1716
yutil
18-
cpp-testing-unittest_main
1917
YDB-CPP-SDK::DiscoveryMutator
2018
YDB-CPP-SDK::Table
2119
LABELS
@@ -27,7 +25,6 @@ add_ydb_test(NAME client-ydb_driver_ut
2725
driver/driver_ut.cpp
2826
LINK_LIBRARIES
2927
yutil
30-
cpp-testing-unittest_main
3128
YDB-CPP-SDK::Driver
3229
YDB-CPP-SDK::Table
3330
LABELS
@@ -53,7 +50,6 @@ add_ydb_test(NAME client-oauth2_ut
5350
oauth2_token_exchange/jwt_token_source_ut.cpp
5451
LINK_LIBRARIES
5552
yutil
56-
cpp-testing-unittest_main
5753
http-server
5854
json
5955
string_utils-base64
@@ -62,12 +58,11 @@ add_ydb_test(NAME client-oauth2_ut
6258
unit
6359
)
6460

65-
add_ydb_test(NAME client-ydb_params_ut
61+
add_ydb_test(NAME client-ydb_params_ut GTEST
6662
SOURCES
6763
params/params_ut.cpp
6864
LINK_LIBRARIES
6965
yutil
70-
cpp-testing-unittest_main
7166
YDB-CPP-SDK::Params
7267
LABELS
7368
unit
@@ -78,19 +73,17 @@ add_ydb_test(NAME client-ydb_result_ut
7873
result/result_ut.cpp
7974
LINK_LIBRARIES
8075
yutil
81-
cpp-testing-unittest_main
8276
YDB-CPP-SDK::Result
8377
YDB-CPP-SDK::Params
8478
LABELS
8579
unit
8680
)
8781

88-
add_ydb_test(NAME client-ydb_value_ut
82+
add_ydb_test(NAME client-ydb_value_ut GTEST
8983
SOURCES
9084
value/value_ut.cpp
9185
LINK_LIBRARIES
9286
yutil
93-
cpp-testing-unittest_main
9487
YDB-CPP-SDK::Value
9588
YDB-CPP-SDK::Params
9689
LABELS

0 commit comments

Comments
 (0)