diff options
author | Fangrui Song <maskray@google.com> | 2019-08-06 09:42:00 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-08-06 09:42:00 +0000 |
commit | d24e6d7bf567802bc466f0324333bc2f143bbd9f (patch) | |
tree | a0dfe234ffb64069255629c4490d5dd31f352f6a /llvm/utils/update_test_checks.py | |
parent | 757ac1ffd50ff2739572f20dd14176ebb7f58fe5 (diff) | |
download | llvm-d24e6d7bf567802bc466f0324333bc2f143bbd9f.zip llvm-d24e6d7bf567802bc466f0324333bc2f143bbd9f.tar.gz llvm-d24e6d7bf567802bc466f0324333bc2f143bbd9f.tar.bz2 |
[UpdateTestChecks] Apply some string concatenation cleanup
Some were what I suggested in D65610.
llvm-svn: 368006
Diffstat (limited to 'llvm/utils/update_test_checks.py')
-rwxr-xr-x | llvm/utils/update_test_checks.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py index 5525863..b73e481 100755 --- a/llvm/utils/update_test_checks.py +++ b/llvm/utils/update_test_checks.py @@ -78,27 +78,27 @@ def main(): test_paths = [] for test in args.tests: if not glob.glob(test): - print('WARNING: Test file \'%s\' was not found. Ignoring it.' % (test,), file=sys.stderr) + print("WARNING: Test file '%s' was not found. Ignoring it." % (test,), file=sys.stderr) continue test_paths.append(test) for test in test_paths: if args.verbose: - print('Scanning for RUN lines in test file: %s' % (test,), file=sys.stderr) + print('Scanning for RUN lines in test file: %s' + test, file=sys.stderr) with open(test) as f: input_lines = [l.rstrip() for l in f] if args.update_only: if len(input_lines) == 0 or 'autogenerated' not in input_lines[0]: - print('Skipping test which isn\'t autogenerated: %s' % (test), file=sys.stderr) - continue; + print("Skipping test which isn't autogenerated: " + test, file=sys.stderr) + continue raw_lines = [m.group(1) for m in [common.RUN_LINE_RE.match(l) for l in input_lines] if m] run_lines = [raw_lines[0]] if len(raw_lines) > 0 else [] for l in raw_lines[1:]: - if run_lines[-1].endswith("\\"): - run_lines[-1] = run_lines[-1].rstrip("\\") + " " + l + if run_lines[-1].endswith('\\'): + run_lines[-1] = run_lines[-1].rstrip('\\') + ' ' + l else: run_lines.append(l) @@ -110,9 +110,9 @@ def main(): prefix_list = [] for l in run_lines: if '|' not in l: - print('WARNING: Skipping unparseable RUN line: %s' % (l,), file=sys.stderr) + print('WARNING: Skipping unparseable RUN line: ' + l, file=sys.stderr) continue - + (tool_cmd, filecheck_cmd) = tuple([cmd.strip() for cmd in l.split('|', 1)]) common.verify_filecheck_prefixes(filecheck_cmd) if not tool_cmd.startswith(opt_basename + ' '): |