aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-02-22 15:59:19 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-02-22 15:59:19 -0800
commit732a875fe82c80a735cc9ca6a430f962811188ab (patch)
treea319fb8bd7d786b2f327888fb9feea0bb79ca6fd /templates/tools/run_tests
parent9f791595903b926e32b3d2ec5d959cfe1a3e1e78 (diff)
Add a sanity test for name aliasing
Diffstat (limited to 'templates/tools/run_tests')
-rw-r--r--templates/tools/run_tests/sources_and_headers.json.template47
1 files changed, 27 insertions, 20 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..cf424edd0b 100644
--- a/templates/tools/run_tests/sources_and_headers.json.template
+++ b/templates/tools/run_tests/sources_and_headers.json.template
@@ -3,34 +3,41 @@
<%!
import json
import os
-
+
def proto_headers(src):
- out = []
- for f in src:
- name, ext = os.path.splitext(f)
- if ext == '.proto':
- out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
- return out
-
+ out = []
+ for f in src:
+ name, ext = os.path.splitext(f)
+ if ext == '.proto':
+ 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
+ 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)
%>
-
+
${json.dumps([{"name": tgt.name,
+ "type": typ,
"language": tgt.language,
+ "third_party": tgt.boringssl or tgt.zlib,
"src": sorted(
- no_protos(tgt.src) +
- tgt.get('public_headers', []) +
+ no_protos(tgt.src) +
+ tgt.get('public_headers', []) +
tgt.get('headers', [])),
"headers": sorted(
- tgt.get('public_headers', []) +
- tgt.get('headers', []) +
+ tgt.get('public_headers', []) +
+ tgt.get('headers', []) +
proto_headers(tgt.src)),
"deps": sorted(tgt.get('deps', []))}
- for tgt in (targets + libs)
- if not tgt.boringssl and not tgt.zlib],
+ for typ, tgt in all_targets(targets, libs)],
sort_keys=True, indent=2)}