aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-02-23 17:13:38 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-02-23 17:13:38 -0800
commit4ea4599a50abb9188927846dc9f5449dbf5e8537 (patch)
tree3e2bb7c622c6e847aeff2c8d4ca0022cefabaa35 /templates/tools/run_tests
parent19fa540100a1b9c28cb9ad6147d1e8d5f9659d82 (diff)
parent0c24f974155809ce8524793c036c24493185fea8 (diff)
Merge github.com:grpc/grpc into naming-crisis
Diffstat (limited to 'templates/tools/run_tests')
-rw-r--r--templates/tools/run_tests/sources_and_headers.json.template27
1 files changed, 17 insertions, 10 deletions
diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template
index cf424edd0b..18b9bc2654 100644
--- a/templates/tools/run_tests/sources_and_headers.json.template
+++ b/templates/tools/run_tests/sources_and_headers.json.template
@@ -12,18 +12,25 @@
out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
return out
- def no_protos(src):
- out = []
- for f in src:
- if os.path.splitext(f)[1] != '.proto':
- out.append(f)
- return out
-
def all_targets(targets, libs):
for tgt in targets:
yield ('target', tgt)
for tgt in libs:
yield ('lib', tgt)
+
+ 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 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,
@@ -31,9 +38,9 @@
"language": tgt.language,
"third_party": tgt.boringssl or tgt.zlib,
"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', []) +