Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Add support for writing merged json
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlucas committed Aug 16, 2015
1 parent 608ba78 commit e3a7796
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions tool/coveralls_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,29 @@ def get_json_from_file(fpath):
return json.load(fp)

def main():
if len(sys.argv) == 1:
print("Usage: {0} <file1> <file2> <outfile>")
return

out = {}
out['source_files'] = []

sources = []

for f in sys.argv[1:]:
for f in sys.argv[1:-1]:
assert os.path.isfile(f)
sources.append(get_json_from_file(f))

for s in sources:
for key in ['git', 'branch', 'remotes']:
if key in s:
out[key] = s[key]

merge_source_files(out['source_files'], s['source_files'])

print(json.dumps(out))

with open(sys.argv[-1], 'wb') as fp:
json.dump(out, fp)

if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion tool/send_coveralls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ done
echo "Covering cpp"
cpp-coveralls -b lib/src -t faketoken --dump coverage/cpp_coverage.json

python tool/coveralls_merge.py coverage/*
python tool/coveralls_merge.py coverage/* merged.json

0 comments on commit e3a7796

Please sign in to comment.