[llvm] r365818 - [UpdateTestChecks] Emit warning when invalid test paths

David Bolvansky via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 13:14:22 PDT 2019


Author: xbolva00
Date: Thu Jul 11 13:14:22 2019
New Revision: 365818

URL: http://llvm.org/viewvc/llvm-project?rev=365818&view=rev
Log:
[UpdateTestChecks] Emit warning when invalid test paths

Summary:
Recently I ran into the following issue:

./update_test_checks.py /path/not-existing-file.ll

The script was silent and I was suprised why the real test file hadn't been updated.

Solution:
Emit warning if we detect this problem.



Reviewers: lebedev.ri, spatel, jdoerfert, nikic

Reviewed By: lebedev.ri, spatel, jdoerfert, nikic

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64572

Modified:
    llvm/trunk/utils/update_test_checks.py

Modified: llvm/trunk/utils/update_test_checks.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/update_test_checks.py?rev=365818&r1=365817&r2=365818&view=diff
==============================================================================
--- llvm/trunk/utils/update_test_checks.py (original)
+++ llvm/trunk/utils/update_test_checks.py Thu Jul 11 13:14:22 2019
@@ -73,7 +73,13 @@ def main():
     sys.exit(1)
   opt_basename = 'opt'
 
-  test_paths = [test for pattern in args.tests for test in glob.glob(pattern)]
+  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)
+      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)




More information about the llvm-commits mailing list