Skip to content

Commit b1f55c3

Browse files
committed
[UpdateTestUtils] Print test filename when complaining about conflicting prefix
Now that FileCheck eagerly complains when prefixes are unused, the update script does the same, and is becoming very common to need to drop some prefixes, yet figuring out the file it complains about isn't obvious unless it actually tells us.
1 parent c5b7335 commit b1f55c3

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

llvm/utils/UpdateTestChecks/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,12 @@ def __str__(self):
291291
return self.scrub
292292

293293
class FunctionTestBuilder:
294-
def __init__(self, run_list, flags, scrubber_args):
294+
def __init__(self, run_list, flags, scrubber_args, path):
295295
self._verbose = flags.verbose
296296
self._record_args = flags.function_signature
297297
self._check_attributes = flags.check_attributes
298298
self._scrubber_args = scrubber_args
299+
self._path = path
299300
# Strip double-quotes if input was read by UTC_ARGS
300301
self._replace_value_regex = list(map(lambda x: x.strip('"'), flags.replace_value_regex))
301302
self._func_dict = {}
@@ -309,7 +310,7 @@ def __init__(self, run_list, flags, scrubber_args):
309310

310311
def finish_and_get_func_dict(self):
311312
for prefix in self._get_failed_prefixes():
312-
warn('Prefix %s had conflicting output from different RUN lines for all functions' % (prefix,))
313+
warn('Prefix %s had conflicting output from different RUN lines for all functions in test %s' % (prefix,self._path,))
313314
return self._func_dict
314315

315316
def func_order(self):

llvm/utils/update_analyze_test_checks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def main():
115115
'function_signature': False,
116116
'check_attributes': False,
117117
'replace_value_regex': []}),
118-
scrubber_args = [])
118+
scrubber_args = [],
119+
path=test)
119120

120121
for prefixes, opt_args in prefix_list:
121122
common.debug('Extracted opt cmd:', opt_basename, opt_args, file=sys.stderr)

llvm/utils/update_cc_test_checks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ def main():
275275
builder = common.FunctionTestBuilder(
276276
run_list=filecheck_run_list,
277277
flags=ti.args,
278-
scrubber_args=[])
278+
scrubber_args=[],
279+
path=ti.path)
279280

280281
for prefixes, args, extra_commands, triple_in_cmd in run_list:
281282
# Execute non-filechecked runline.

llvm/utils/update_llc_test_checks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def main():
114114
'function_signature': False,
115115
'check_attributes': False,
116116
'replace_value_regex': []}),
117-
scrubber_args=[ti.args])
117+
scrubber_args=[ti.args],
118+
path=ti.path)
118119

119120
for prefixes, llc_tool, llc_args, preprocess_cmd, triple_in_cmd, march_in_cmd in run_list:
120121
common.debug('Extracted LLC cmd:', llc_tool, llc_args)

llvm/utils/update_test_checks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ def main():
113113
builder = common.FunctionTestBuilder(
114114
run_list=prefix_list,
115115
flags=ti.args,
116-
scrubber_args=[])
116+
scrubber_args=[],
117+
path=ti.path)
117118

118119
for prefixes, opt_args, preprocess_cmd in prefix_list:
119120
common.debug('Extracted opt cmd: ' + opt_basename + ' ' + opt_args)

0 commit comments

Comments
 (0)