[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
Fri Aug 2 03:35:55 PDT 2019


MaskRay added inline comments.


================
Comment at: utils/update_test_checks.py:65
       '--function', help='The function in the test file to update')
+  parser.add_argument('--update-only', action="store_true",
+                      help='Only update test if it was already autogened')
----------------
Prefer single quotes.


================
Comment at: utils/update_test_checks.py:92
+    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)
----------------
`'autogenerated'`


================
Comment at: utils/update_test_checks.py:113
+      if "|" not in l:
+        print('WARNING: Skipping unparseable RUN line: %s' % (l), file=sys.stderr)
+        continue
----------------
`'...........{}'.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`.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65610





More information about the llvm-commits mailing list