diff options
author | Brad King <brad.king@kitware.com> | 2016-11-17 16:36:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-18 14:43:22 (GMT) |
commit | 80ebc55a7ce934ee357c30713bcb96b209e97963 (patch) | |
tree | d57f5b3f499669d4d0290a09e7f4a535e7933a9c /Tests/RunCMake/pseudo_tidy.c | |
parent | ce1abfa4149ae0b3920626bef2dd15e8ee8b1940 (diff) | |
download | CMake-80ebc55a7ce934ee357c30713bcb96b209e97963.zip CMake-80ebc55a7ce934ee357c30713bcb96b209e97963.tar.gz CMake-80ebc55a7ce934ee357c30713bcb96b209e97963.tar.bz2 |
cmake: Report if the <LANG>_CLANG_TIDY tool exits with non-zero
When using `<LANG>_CLANG_TIDY` our internal launcher for the tool must
capture its return code and stderr and report them on failure.
Otherwise incorrect command lines silently fail.
Closes: #16435
Diffstat (limited to 'Tests/RunCMake/pseudo_tidy.c')
-rw-r--r-- | Tests/RunCMake/pseudo_tidy.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |