summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-21 15:02:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-11-21 15:02:02 (GMT)
commit95cfb5457959cb221af60a63a39bc152bb024e58 (patch)
treecad4b7676cd8e42ad053a537caa314356d1082f4 /Tests/RunCMake
parent45d74e9ad32592856852f92471c658256b619e6a (diff)
parent80ebc55a7ce934ee357c30713bcb96b209e97963 (diff)
downloadCMake-95cfb5457959cb221af60a63a39bc152bb024e58.zip
CMake-95cfb5457959cb221af60a63a39bc152bb024e58.tar.gz
CMake-95cfb5457959cb221af60a63a39bc152bb024e58.tar.bz2
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
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/ClangTidy/C-bad-Build-result.txt1
-rw-r--r--Tests/RunCMake/ClangTidy/C-bad-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/ClangTidy/C-bad.cmake3
-rw-r--r--Tests/RunCMake/ClangTidy/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/pseudo_iwyu.c3
-rw-r--r--Tests/RunCMake/pseudo_tidy.c6
6 files changed, 15 insertions, 1 deletions
diff --git a/Tests/RunCMake/ClangTidy/C-bad-Build-result.txt b/Tests/RunCMake/ClangTidy/C-bad-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/C-bad-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/ClangTidy/C-bad-Build-stdout.txt b/Tests/RunCMake/ClangTidy/C-bad-Build-stdout.txt
new file mode 100644
index 0000000..2370ce1
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/C-bad-Build-stdout.txt
@@ -0,0 +1,2 @@
+stdout from bad command line arg '-bad'
+stderr from bad command line arg '-bad'
diff --git a/Tests/RunCMake/ClangTidy/C-bad.cmake b/Tests/RunCMake/ClangTidy/C-bad.cmake
new file mode 100644
index 0000000..aa54c08
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/C-bad.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_C_CLANG_TIDY "${PSEUDO_TIDY}" -bad)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake b/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake
index 27cd922..2f41e50 100644
--- a/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake
@@ -20,3 +20,4 @@ if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
run_tidy(C-launch)
run_tidy(CXX-launch)
endif()
+run_tidy(C-bad)
diff --git a/Tests/RunCMake/pseudo_iwyu.c b/Tests/RunCMake/pseudo_iwyu.c
index 1e25de7..c761741 100644
--- a/Tests/RunCMake/pseudo_iwyu.c
+++ b/Tests/RunCMake/pseudo_iwyu.c
@@ -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;
}
diff --git a/Tests/RunCMake/pseudo_tidy.c b/Tests/RunCMake/pseudo_tidy.c
index c950d03..2feeb0f 100644
--- a/Tests/RunCMake/pseudo_tidy.c
+++ b/Tests/RunCMake/pseudo_tidy.c
@@ -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;