diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-06-25 06:58:00 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-06-25 06:58:00 -0700 |
commit | f75fc12e3a1a614ee2d5d565742764e47d9aef96 (patch) | |
tree | 2a6c23e2e778f2c976fbe7aafb8f5069713d3525 /templates/tools | |
parent | be79da21c5fab8cfc34c594ff27a28975b565eab (diff) |
Add a test that headers are properly in build.json
Clean up anything that failed
Diffstat (limited to 'templates/tools')
-rw-r--r-- | templates/tools/run_tests/sources_and_headers.json.template | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template new file mode 100644 index 0000000000..01918d0a3d --- /dev/null +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -0,0 +1,27 @@ +<%! +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 + +def no_protos(src): + out = [] + for f in src: + if os.path.splitext(f)[1] != '.proto': + out.append(f) + return out +%> + +${json.dumps([{"name": tgt.name, + "language": tgt.language, + "src": no_protos(tgt.src) + tgt.get('public_headers', []) + tgt.get('headers', []), + "headers": tgt.get('public_headers', []) + tgt.get('headers', []) + proto_headers(tgt.src), + "deps": tgt.get('deps', [])} + for tgt in (targets + libs)], + sort_keys=True, indent=2)} |