From bfcc20343c966ee031426e04c5eab504a0af8e27 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 30 Nov 2017 17:36:43 -0500 Subject: Update cpplint support to return 0 and mark warnings for CDash. This commit makes cpplint act like the other compiler mirroring tools. It will always return 0 even if it reports warnings and will only return non zero if there is a problem running the command. In addition, it will now add some extra text to allow CTest to recognize the warnings and report them correctly to CDash. --- Source/cmcmd.cxx | 6 ++++-- Tests/RunCMake/Cpplint/C-error-Build-result.txt | 2 +- Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt | 2 +- Tests/RunCMake/Cpplint/CXX-error-Build-result.txt | 2 +- Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 3d9f65a..b78fbe6 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -270,10 +270,12 @@ static int HandleCppLint(const std::string& runCmd, << "\n"; return 1; } - + std::cerr << "Warning: cpplint diagnostics:\n"; // Output the output from cpplint to stderr std::cerr << stdOut; - return ret; + // always return 0 so the build can continue as cpplint returns non-zero + // for any warning + return 0; } static int HandleCppCheck(const std::string& runCmd, diff --git a/Tests/RunCMake/Cpplint/C-error-Build-result.txt b/Tests/RunCMake/Cpplint/C-error-Build-result.txt index d197c91..573541a 100644 --- a/Tests/RunCMake/Cpplint/C-error-Build-result.txt +++ b/Tests/RunCMake/Cpplint/C-error-Build-result.txt @@ -1 +1 @@ -[^0] +0 diff --git a/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt b/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt index d197c91..573541a 100644 --- a/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt +++ b/Tests/RunCMake/Cpplint/C-error-launch-Build-result.txt @@ -1 +1 @@ -[^0] +0 diff --git a/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt b/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt index d197c91..573541a 100644 --- a/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt +++ b/Tests/RunCMake/Cpplint/CXX-error-Build-result.txt @@ -1 +1 @@ -[^0] +0 diff --git a/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt b/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt index d197c91..573541a 100644 --- a/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt +++ b/Tests/RunCMake/Cpplint/CXX-error-launch-Build-result.txt @@ -1 +1 @@ -[^0] +0 -- cgit v0.12