aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/tools
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-02-11 15:49:16 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-02-11 15:49:16 -0800
commiteb841e20108e0e54f99800f099c044f9f183a632 (patch)
tree67cf845f9641e7ae783fe896db847896e158487c /templates/tools
parent3470054993fffed0f813a43ade6cb4aa6322fe23 (diff)
Revert "Revert "Proto API for LB request/responses""
Diffstat (limited to 'templates/tools')
-rw-r--r--templates/tools/run_tests/sources_and_headers.json.template21
1 files changed, 14 insertions, 7 deletions
diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template
index 04802772af..78363ff1fa 100644
--- a/templates/tools/run_tests/sources_and_headers.json.template
+++ b/templates/tools/run_tests/sources_and_headers.json.template
@@ -12,20 +12,27 @@
out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
return out
- def no_protos(src):
+ def no_protos_filter(src):
+ return os.path.splitext(src)[1] != '.proto'
+
+ def no_third_party_filter(src):
+ return not src.startswith('third_party/')
+
+ def filter_srcs(srcs, filters):
out = []
- for f in src:
- if os.path.splitext(f)[1] != '.proto':
- out.append(f)
+ for s in srcs:
+ filter_passes = (f(s) for f in filters)
+ if all(filter_passes):
+ out.append(s)
return out
%>
${json.dumps([{"name": tgt.name,
"language": tgt.language,
"src": sorted(
- no_protos(tgt.src) +
- tgt.get('public_headers', []) +
- tgt.get('headers', [])),
+ filter_srcs(tgt.src, (no_protos_filter, no_third_party_filter)) +
+ filter_srcs(tgt.get('public_headers', []), (no_protos_filter, no_third_party_filter)) +
+ filter_srcs(tgt.get('headers', []), (no_third_party_filter,))),
"headers": sorted(
tgt.get('public_headers', []) +
tgt.get('headers', []) +