Skip to content

Commit d91a0fa

Browse files
authored
Merge pull request #5 from lizan/visibility_test
Make transcoding compile with istio/proxy
2 parents 89de170 + 91807a2 commit d91a0fa

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/BUILD

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
################################################################################
1616
#
17-
package(default_visibility = ["//visibility:private"])
17+
package(default_visibility = ["//visibility:public"])
1818

1919
load("@protobuf_git//:protobuf.bzl", "cc_proto_library")
2020

@@ -97,9 +97,6 @@ cc_library(
9797
hdrs = [
9898
"path_matcher.h",
9999
],
100-
visibility = [
101-
"//visibility:public",
102-
],
103100
deps = [
104101
":http_template",
105102
],
@@ -113,9 +110,6 @@ cc_library(
113110
hdrs = [
114111
"http_template.h",
115112
],
116-
visibility = [
117-
"//visibility:public",
118-
],
119113
)
120114

121115
cc_library(
@@ -167,7 +161,6 @@ cc_library(
167161
srcs = [
168162
"transcoder_input_stream.h",
169163
],
170-
visibility = ["//visibility:public"],
171164
deps = [
172165
"@protobuf_git//:protobuf",
173166
],
@@ -178,11 +171,11 @@ cc_library(
178171
hdrs = [
179172
"transcoder.h",
180173
],
181-
visibility = ["//visibility:public"],
182174
deps = [
183175
":json_request_translator",
184176
":message_stream",
185177
":response_to_json_translator",
178+
":type_helper",
186179
"//external:protobuf",
187180
],
188181
)

src/test_common.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ std::string GenerateInput(const std::string& seed, size_t size) {
186186

187187
namespace {
188188

189-
std::string LoadFile(const std::string& input_file_name) {
190-
const char kTestdata[] = "src/testdata/";
191-
std::string file_name = std::string(kTestdata) + input_file_name;
192-
189+
std::string LoadFile(const std::string& file_name) {
193190
std::ifstream ifs(file_name);
194191
if (!ifs) {
195192
ADD_FAILURE() << "Could not open " << file_name.c_str() << std::endl;
@@ -203,8 +200,9 @@ std::string LoadFile(const std::string& input_file_name) {
203200
} // namespace
204201

205202
bool LoadService(const std::string& config_pb_txt_file,
203+
const std::string& testdata_path,
206204
::google::api::Service* service) {
207-
auto config = LoadFile(config_pb_txt_file);
205+
auto config = LoadFile(testdata_path + config_pb_txt_file);
208206
if (config.empty()) {
209207
return false;
210208
}
@@ -218,6 +216,12 @@ bool LoadService(const std::string& config_pb_txt_file,
218216
}
219217
}
220218

219+
bool LoadService(const std::string& config_pb_txt_file,
220+
::google::api::Service* service) {
221+
static const char kTestdata[] = "src/testdata/";
222+
return LoadService(config_pb_txt_file, kTestdata, service);
223+
}
224+
221225
unsigned DelimiterToSize(const unsigned char* delimiter) {
222226
unsigned size = 0;
223227
// Bytes 1-4 are big-endian 32-bit message size

src/test_common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ std::string GenerateInput(const std::string& seed, size_t size);
8888

8989
// Load service from a proto text file. Returns true if loading succeeds;
9090
// otherwise returns false.
91+
bool LoadService(const std::string& config_pb_txt_file,
92+
const std::string& testdata_path,
93+
::google::api::Service* service);
9194
bool LoadService(const std::string& config_pb_txt_file,
9295
::google::api::Service* service);
9396

0 commit comments

Comments
 (0)