[PATCH] D65610: Robustify update_test_checks.py to non-autogened tests, and add a mode to skip non-autogenerated ones

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 4 09:36:32 PDT 2019


MaskRay accepted this revision.
MaskRay added inline comments.
This revision is now accepted and ready to land.


================
Comment at: utils/update_test_checks.py:113
+      if "|" not in l:
+        print('WARNING: Skipping unparseable RUN line: %s' % (l), file=sys.stderr)
+        continue
----------------
reames wrote:
> MaskRay wrote:
> > `'...........{}'.format(l)` is usually preferred over `print('WARNING: Skipping unparseable RUN line: %s' % (l,), file=sys.stderr)` (note comma after `l`l)
> > 
> > The comma makes it a one-element tuple. `(l)` is the same as `l`.
> I'd prefer to follow the style of all the surrounding code which uses this construct.  
> 
> p.s. The common vs non-common form appear to evaluate exactly the same.  (Based on the output of a test only)
Alternatively, `'WARNING: Skipping unparseable RUN line: ' + l`

`%s` can mean str, int, list (`[1,2,3]`) and many other strings that can be converted to a str via `str()`.


================
Comment at: utils/update_test_checks.py:93
+      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;
----------------
`"Skipping test which isn't autogenerated: " + test`


================
Comment at: utils/update_test_checks.py:112
     for l in run_lines:
+      if "|" not in l:
+        print('WARNING: Skipping unparseable RUN line: %s' % (l,), file=sys.stderr)
----------------
`'|'`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65610/new/

https://reviews.llvm.org/D65610





More information about the llvm-commits mailing list