[llvm] 58e646c - update_test_checks.py: pick up --tool from UTC_ARGS

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 01:06:47 PST 2023


Author: Nicolai Hähnle
Date: 2023-01-25T10:06:03+01:00
New Revision: 58e646c0e882a98fe71bc8ed469d43ad081b0f32

URL: https://github.com/llvm/llvm-project/commit/58e646c0e882a98fe71bc8ed469d43ad081b0f32
DIFF: https://github.com/llvm/llvm-project/commit/58e646c0e882a98fe71bc8ed469d43ad081b0f32.diff

LOG: update_test_checks.py: pick up --tool from UTC_ARGS

It's not clear to me how to write a test for this. The tests run in an
environment where the tools may not be in PATH, and so the existing
custom-tool.test needs to use --tool-binary when invoking
update_test_checks.py. But it can't do so without also using --tool.

This change does fix a problem though with using
update_any_test_checks.py in an environment where the tools *are*
available in PATH.

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

Added: 
    

Modified: 
    llvm/utils/update_test_checks.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index e43efa3ea924..c3d8ef87ffef 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -71,7 +71,6 @@ def main():
     if not re.match(r'^%s(-\d+)?(\.exe)?$' % (initial_args.tool), tool_basename):
       common.error('Unexpected tool name: ' + tool_basename)
       sys.exit(1)
-  tool_basename = initial_args.tool
 
   for ti in common.itertests(initial_args.tests, parser,
                              script_name='utils/' + script_name):
@@ -81,6 +80,8 @@ def main():
     else:
       common.SCRUB_TRAILING_WHITESPACE_TEST_RE = common.SCRUB_TRAILING_WHITESPACE_RE
 
+    tool_basename = ti.args.tool
+
     prefix_list = []
     for l in ti.run_lines:
       if '|' not in l:


        


More information about the llvm-commits mailing list