Skip to content

Commit 59e8ef1

Browse files
committed
Change the open source logic to use firebase_cpp_cc_test instead of cc_test
The Firestore iOS SDK defines cc_test already, which is causing conflicts. Rename the C++ testing infrastructure to use firebase_cpp_cc_test, which is less likely to have issues. PiperOrigin-RevId: 298426910
1 parent cc15c76 commit 59e8ef1

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

app/rest/tests/CMakeLists.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Google
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -42,22 +42,22 @@ target_include_directories(sample_resource_lib
4242
${FLATBUFFERS_SOURCE_DIR}/include
4343
)
4444

45-
cc_test(firebase_app_rest_request_test
45+
firebase_cpp_cc_test(firebase_app_rest_request_test
4646
SOURCES
4747
request_test.h
4848
request_test.cc
4949
DEPENDS
5050
firebase_rest_lib
5151
)
5252

53-
cc_test(firebase_app_rest_request_binary_test
53+
firebase_cpp_cc_test(firebase_app_rest_request_binary_test
5454
SOURCES
5555
request_binary_test.cc
5656
DEPENDS
5757
firebase_rest_lib
5858
)
5959

60-
cc_test(firebase_app_rest_request_json_test
60+
firebase_cpp_cc_test(firebase_app_rest_request_json_test
6161
SOURCES
6262
../request_json.h
6363
request_json_test.cc
@@ -67,43 +67,43 @@ cc_test(firebase_app_rest_request_json_test
6767
sample_resource_lib
6868
)
6969

70-
cc_test(firebase_app_rest_response_test
70+
firebase_cpp_cc_test(firebase_app_rest_response_test
7171
SOURCES
7272
response_test.cc
7373
DEPENDS
7474
firebase_rest_lib
7575
)
7676

77-
cc_test(firebase_app_rest_response_binary_test
77+
firebase_cpp_cc_test(firebase_app_rest_response_binary_test
7878
SOURCES
7979
response_binary_test.cc
8080
DEPENDS
8181
firebase_rest_lib
8282
)
8383

84-
cc_test(firebase_app_rest_response_json_test
84+
firebase_cpp_cc_test(firebase_app_rest_response_json_test
8585
SOURCES
8686
response_json_test.cc
8787
DEPENDS
8888
firebase_rest_lib
8989
sample_resource_lib
9090
)
9191

92-
cc_test(firebase_app_rest_util_test
92+
firebase_cpp_cc_test(firebase_app_rest_util_test
9393
SOURCES
9494
util_test.cc
9595
DEPENDS
9696
firebase_rest_lib
9797
)
9898

99-
cc_test(firebase_app_rest_www_form_url_encoded_test
99+
firebase_cpp_cc_test(firebase_app_rest_www_form_url_encoded_test
100100
SOURCES
101101
www_form_url_encoded_test.cc
102102
DEPENDS
103103
firebase_rest_lib
104104
)
105105

106-
cc_test(firebase_app_rest_transport_mock_test
106+
firebase_cpp_cc_test(firebase_app_rest_transport_mock_test
107107
SOURCES
108108
transport_mock_test.cc
109109
../transport_mock.h
@@ -119,31 +119,31 @@ cc_test(firebase_app_rest_transport_mock_test
119119
#[[
120120
121121
# google3 Dependency: FLAGS_test_tmpdir, CHECK(), CHECK_EQ
122-
cc_test(firebase_app_rest_request_file_test
122+
firebase_cpp_cc_test(firebase_app_rest_request_file_test
123123
SOURCES
124124
request_file_test.cc
125125
DEPENDS
126126
firebase_rest_lib
127127
)
128128
129129
# google3 Dependency: absl/strings/escaping (absl::CEscape)
130-
cc_test(firebase_app_rest_gzipheader_unittest
130+
firebase_cpp_cc_test(firebase_app_rest_gzipheader_unittest
131131
SOURCES
132132
gzipheader_unittest.cc
133133
DEPENDS
134134
firebase_rest_lib
135135
)
136136
137137
# google3 Dependency: absl/strings/escaping (absl::CEscape)
138-
cc_test(firebase_app_rest_zlibwrapper_unittest
138+
firebase_cpp_cc_test(firebase_app_rest_zlibwrapper_unittest
139139
SOURCES
140140
zlibwrapper_unittest.cc
141141
DEPENDS
142142
firebase_rest_lib
143143
)
144144
145145
# google3 Dependency: net/.../http2server, net/util/ports.h (net_util::PickUnusedPort())
146-
cc_test(firebase_app_rest_transport_curl_test
146+
firebase_cpp_cc_test(firebase_app_rest_transport_curl_test
147147
SOURCES
148148
transport_curl_test.cc
149149
DEPENDS

cmake/test_rules.cmake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Google
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -14,10 +14,12 @@
1414

1515
include(CMakeParseArguments)
1616

17-
# cc_test(
17+
# firebase_cpp_cc_test(
1818
# target
1919
# SOURCES sources...
2020
# DEPENDS libraries...
21+
# INCLUDES include directories...
22+
# DEFINES definitions...
2123
# )
2224
#
2325
# Defines a new test executable target with the given target name, sources, and
@@ -28,7 +30,7 @@ function(cc_test name)
2830
endif()
2931

3032
set(multi DEPENDS SOURCES INCLUDES DEFINES)
31-
# Parse the arguments into cc_test_SOURCES and cc_test_DEPENDS.
33+
# Parse the arguments into cc_test_SOURCES, ..._DEPENDS, etc.
3234
cmake_parse_arguments(cc_test "" "" "${multi}" ${ARGN})
3335

3436
list(APPEND cc_test_DEPENDS gmock gtest gtest_main)
@@ -96,7 +98,7 @@ function(ios_test_add_frameworks name)
9698
GoogleDataTransport GoogleDataTransportCCTSupport
9799
GoogleUtilities nanopb )
98100

99-
foreach(FRAMEWORK IN LISTS DEFAULT_FRAMEWORKS
101+
foreach(FRAMEWORK IN LISTS DEFAULT_FRAMEWORKS
100102
ios_test_add_frameworks_CUSTOM_FRAMEWORKS)
101103
LIST(APPEND INCLUDES "-framework ${FRAMEWORK}")
102104
endforeach()
@@ -105,7 +107,7 @@ function(ios_test_add_frameworks name)
105107
set(FRAMEWORK_INCLUDES ${INCLUDES} PARENT_SCOPE)
106108
endfunction()
107109

108-
# cc_test_on_ios(
110+
# firebase_cpp_cc_test_on_ios(
109111
# target
110112
# HOST host
111113
# SOURCES sources...
@@ -121,7 +123,7 @@ endfunction()
121123

122124
# baseline FirebaseAnalytics. DEFINES will be added to the
123125
# target_compile_definitions call.
124-
function(cc_test_on_ios name)
126+
function(firebase_cpp_cc_test_on_ios name)
125127
if (NOT IOS)
126128
return()
127129
endif()

0 commit comments

Comments
 (0)