diff options
author | ncteisen <ncteisen@gmail.com> | 2017-07-14 19:17:27 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-07-14 19:17:27 -0700 |
commit | bdc6f70a55252e62340119ed192475c6c15f427a (patch) | |
tree | 27a3658b4bde5fd0e7ac54d72f512785763554e6 /tools | |
parent | 15f77669a42792196de5ef1433d58d93b667b64c (diff) |
Smarter regex, blander algo
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/run_tests/sanity/check_tracer_sanity.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tools/run_tests/sanity/check_tracer_sanity.py b/tools/run_tests/sanity/check_tracer_sanity.py index d99471f07f..997ec79d02 100755 --- a/tools/run_tests/sanity/check_tracer_sanity.py +++ b/tools/run_tests/sanity/check_tracer_sanity.py @@ -30,17 +30,9 @@ for root, dirs, files in os.walk('src/core'): path = os.path.join(root, filename) if os.path.splitext(path)[1] != '.c': continue with open(path) as f: - text = f.readlines() - for i in range(len(text)): - if "grpc_tracer_flag" in text[i]: - line = text[i].replace('\n', ' ') - j = i - while ";" not in text[j]: - j += 1 - line += text[j].replace('\n', ' ') - if "GRPC_TRACER_INITIALIZER" not in line: continue - t = pattern.search(line).group(2) - if t not in tracers: tracers.append(t) + text = f.read() + for o in pattern.findall(text): + tracers.append(o[1]) with open('doc/environment_variables.md') as f: text = f.read() |