Fix sarif-multi-diagnostic-test.c failure on Windows #987
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the llvm/clang unit tests are non-portable to Windows because they were
mainly written for Linux by the community and somehow made to work on Windows.
The issue with the
sarif-multi-diagnostics
test seems to be due to grep. Due tothe presence of a Unicode string in this test grep considers this file as a
binary file instead of a text file and hence errors out with the following
message:
Binary file (standard input) matches
So we need to tell grep to treat this file as a text file for comparison
purposes. This can be done via the
-a
flag to grep. With this fix the test nowpasses on ADO. The git log commit messages for the file
clang/test/Analysis/lit.local.cfg
which I fixed mentions the non-portablenature of these tests.