This is an archive of the discontinued LLVM Phabricator instance.

Modify test to look for patterns in stderr as well
ClosedPublic

Authored by sepavloff on May 14 2017, 10:52 AM.

Details

Summary

With the change https://reviews.llvm.org/D33013 driver does not build
compilation object if command line is invalid, in particular, if
unrecognized option is provided. In such cases it prints diagnostics
on stderr. The test 'clang-tidy/diagnostic.cpp' checks reaction on
unrecognized option and will fail when D33013 is applied. With this
change the test works in either case.

Diff Detail

Repository
rL LLVM

Event Timeline

sepavloff created this revision.May 14 2017, 10:52 AM
alexfh edited edge metadata.May 15 2017, 4:46 AM

Feel free to commit this to fix buildbots, however the underlying D33013 raises some questions.

Clang-tidy is also used as a library, in which case it should capture all compiler diagnostics and pass them to the caller. This test verifies that clang-tidy actually captures the compilation error, and with D33013 this seems to have broken for the diagnostics related to command line parsing. Modifying the driver to directly output these errors to stderr instead of using DiagnosticConsumer seems like a wrong thing to do.

This revision was automatically updated to reflect the committed changes.