================
@@ -250,39 +291,61 @@ def check_no_diagnosis(self, clang_tidy_output: str) ->
None:
if clang_tidy_output != "":
sys.exit("No diagnostics were expected, but found the ones above")
- def check_fixes(self) -> None:
- if self.has_check_fixes:
- try_run(
- [
- "FileCheck",
- "--input-file=" + self.temp_file_name,
- self.input_file_name,
- "--check-prefixes=" + ",".join(self.fixes.prefixes),
- (
- "--match-full-lines"
- if not self.match_partial_fixes
- else "--strict-whitespace" # Keeping past behavior.
- ),
- ]
- )
+ def check_fixes(self, input_file: str = "", check_file: str = "") -> None:
----------------
zeyi2 wrote:
The diff here is a bit messy, so I will try to describe what's happening here:
The `check_fixes` function has been generalized to support verifying any file,
not just the main input file.
It used to hardcode the check against `self.temp_file_name`, now it accepts
optional `input_file` and `check_file` arguments.
- If arguments are omitted, it defaults to checking the main file (backward
compatibility).
- If arguments are provided, it can be reused to verify fixes in the header
files.
It also now uses `_filter_prefixes` to ensure we don't pass unused prefixes to
`FileCheck`.
`check_messages` is nearly the same as `check_fixes`, so I will omit it here.
https://github.com/llvm/llvm-project/pull/175735
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits