summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-09-22 18:04:13 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-09-22 18:04:13 (GMT)
commit43fe0d3978a81b74be42c0e975bdfe0092778b48 (patch)
treeea9ef04f8c3cf88521ed08cdbfe7e52dfe4405ea /Source
parentae9f9e6994c430d697387bb005616bda4a9c09b8 (diff)
downloadCMake-43fe0d3978a81b74be42c0e975bdfe0092778b48.zip
CMake-43fe0d3978a81b74be42c0e975bdfe0092778b48.tar.gz
CMake-43fe0d3978a81b74be42c0e975bdfe0092778b48.tar.bz2
ENH: add max width option to ctest ouptut
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx5
-rw-r--r--Source/cmCTest.cxx12
-rw-r--r--Source/cmCTest.h8
-rw-r--r--Source/ctest.cxx5
4 files changed, 26 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 83d882b..f8084a9 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -644,8 +644,9 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
cmCTestLog(this->CTest, HANDLER_OUTPUT, "Testing");
}
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
- std::string outname = testname;
- outname.resize(30, ' ');
+ const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth();
+ std::string outname = testname + " ";
+ outname.resize(maxTestNameWidth, '.');
*this->LogFile << cnt << "/" << tmsize << " Testing: " << testname
<< std::endl;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 012571f..c3033de 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -249,6 +249,7 @@ cmCTest::cmCTest()
this->ShowOnly = false;
this->RunConfigurationScript = false;
this->TestModel = cmCTest::EXPERIMENTAL;
+ this->MaxTestNameWidth = 30;
this->InteractiveDebugMode = true;
this->TimeOut = 0;
this->CompressXMLFiles = false;
@@ -1721,6 +1722,11 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
{
this->ForceNewCTestProcess = true;
}
+ if(this->CheckArgument(arg, "-W", "--max-width") && i < args.size() - 1)
+ {
+ i++;
+ this->MaxTestNameWidth = atoi(args[i].c_str());
+ }
if(this->CheckArgument(arg, "--interactive-debug-mode") &&
i < args.size() - 1 )
{
@@ -2310,6 +2316,12 @@ bool cmCTest::GetShowOnly()
}
//----------------------------------------------------------------------
+int cmCTest::GetMaxTestNameWidth() const
+{
+ return this->MaxTestNameWidth;
+}
+
+//----------------------------------------------------------------------
void cmCTest::SetProduceXML(bool v)
{
this->ProduceXML = v;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 01d3b42..a337460 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -168,7 +168,11 @@ public:
///! Should we only show what we would do?
bool GetShowOnly();
- /**
+
+ ///! The max output width
+ int GetMaxTestNameWidth() const;
+
+ /**
* Run a single executable command and put the stdout and stderr
* in output.
*
@@ -373,6 +377,8 @@ private:
double TimeOut;
+ int MaxTestNameWidth;
+
std::string ParallelCacheFile;
int ParallelLevel;
int ParallelSubprocessId;
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index ddd22ad..9401574 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -128,8 +128,11 @@ static const char * cmDocumentationOptions[][3] =
{"-U, --union", "Take the Union of -I and -R",
"When both -R and -I are specified by default the intersection of "
"tests are run. By specifying -U the union of tests is run instead."},
+ {"--max-width <width>", "Set the max width for a test name to output",
+ "Set the maximum width for each test name to show in the output. This "
+ "allows the user to widen the output to avoid cliping the test name which "
+ "can be very annoying."},
{"--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1.",
-
"This option causes ctest to run tests in either an interactive mode or "
"a non-interactive mode. On Windows this means that in non-interactive "
"mode, all system debug pop up windows are blocked. In dashboard mode "