gcc/testsuite/g++.dg/gcov/gcov.py
raw| 1 | import gzip |
| 2 | import json |
| 3 | import os |
| 4 | |
| 5 | |
| 6 | def gcov_from_env(): |
| 7 | # return parsed JSON content a GCOV_PATH file |
| 8 | json_filename = os.environ['GCOV_PATH'] |
| 9 | # strip extension |
| 10 | json_filename = json_filename[:json_filename.rindex('.')] |
| 11 | json_filename += '.gcov.json.gz' |
| 12 | json_data = gzip.open(json_filename).read() |
| 13 | return json.loads(json_data) |