Merge topic 'capture-clang-tidy-errors'

80ebc55a cmake: Report if the <LANG>_CLANG_TIDY tool exits with non-zero
ce1abfa4 cmake: If ldd for LINK_WHAT_YOU_USE fails to run then report why
44de6157 cmake: Comment why we ignore the include-what-you-use return code
This commit is contained in:
Brad King
2016-11-21 10:02:02 -05:00
committed by CMake Topic Stage
8 changed files with 39 additions and 7 deletions
@@ -0,0 +1 @@
[^0]
@@ -0,0 +1,2 @@
stdout from bad command line arg '-bad'
stderr from bad command line arg '-bad'
+3
View File
@@ -0,0 +1,3 @@
enable_language(C)
set(CMAKE_C_CLANG_TIDY "${PSEUDO_TIDY}" -bad)
add_executable(main main.c)
@@ -20,3 +20,4 @@ if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
run_tidy(C-launch)
run_tidy(CXX-launch)
endif()
run_tidy(C-bad)
+2 -1
View File
@@ -3,5 +3,6 @@
int main(void)
{
fprintf(stderr, "should add these lines:\n#include <...>\n");
return 0;
/* include-what-you-use always returns failure */
return 1;
}
+6
View File
@@ -1,9 +1,15 @@
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
int i;
for (i = 1; i < argc; ++i) {
if (strcmp(argv[i], "-bad") == 0) {
fprintf(stdout, "stdout from bad command line arg '-bad'\n");
fprintf(stderr, "stderr from bad command line arg '-bad'\n");
return 1;
}
if (argv[i][0] != '-') {
fprintf(stdout, "%s:0:0: warning: message [checker]\n", argv[i]);
break;