diff options
author | Roman Wüger <roman.wueger@gmx.at> | 2015-09-17 15:06:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-18 15:32:06 (GMT) |
commit | fd47df45030733341858fa33ee96015d64c73c03 (patch) | |
tree | d763169672205165693ac1afb9ff3af525bd2681 /Source/cmCTest.cxx | |
parent | 6e3151f6ccd035ffd704d3cb0162c873d5e95e15 (diff) | |
download | CMake-fd47df45030733341858fa33ee96015d64c73c03.zip CMake-fd47df45030733341858fa33ee96015d64c73c03.tar.gz CMake-fd47df45030733341858fa33ee96015d64c73c03.tar.bz2 |
CTest: Add options to limit output of passed and failed tests
Add ctest command-line options:
--test-output-size-passed <n>
--test-output-size-failed <n>
to set the amount of test output to store in Test.xml as a command-line
dashboard client.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index b2ad4a8..6e55d89 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2165,7 +2165,46 @@ bool cmCTest::HandleCommandLineArguments(size_t &i, { this->OutputTestOutputOnTestFailure = true; } - + if (this->CheckArgument(arg, "--test-output-size-passed") && + i < args.size() - 1) + { + i++; + long outputSize; + if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize)) + { + if (cmCTestTestHandler *pCTestTestHandler = + static_cast<cmCTestTestHandler*>(this->TestingHandlers["test"])) + { + pCTestTestHandler->SetTestOutputSizePassed(int(outputSize)); + } + } + else + { + cmCTestLog(this, WARNING, + "Invalid value for '--test-output-size-passed': " << + args[i] << "\n"); + } + } + if (this->CheckArgument(arg, "--test-output-size-failed") && + i < args.size() - 1) + { + i++; + long outputSize; + if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize)) + { + if (cmCTestTestHandler *pCTestTestHandler = + static_cast<cmCTestTestHandler*>(this->TestingHandlers["test"])) + { + pCTestTestHandler->SetTestOutputSizeFailed(int(outputSize)); + } + } + else + { + cmCTestLog(this, WARNING, + "Invalid value for '--test-output-size-failed': " << + args[i] << "\n"); + } + } if(this->CheckArgument(arg, "-N", "--show-only")) { this->ShowOnly = true; |