summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx27
1 files changed, 19 insertions, 8 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 0026fd7..df61fe6 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1343,16 +1343,21 @@ int cmCTest::RunTest(std::vector<const char*> argv,
}
*retVal = inst.Run(args, output);
- *output += oss.str();
- if ( log )
+ if(output)
+ {
+ *output += oss.str();
+ }
+ if ( log && output)
{
*log << *output;
}
cmSystemTools::ChangeDirectory(oldpath);
-
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- "Internal cmCTest object used to run test." << std::endl
- << *output << std::endl);
+ if(output)
+ {
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
+ "Internal cmCTest object used to run test." << std::endl
+ << *output << std::endl);
+ }
return cmsysProcess_State_Exited;
}
@@ -1422,7 +1427,10 @@ int cmCTest::RunTest(std::vector<const char*> argv,
*retVal = cmsysProcess_GetExitException(cp);
std::string outerr = "\n*** Exception executing: ";
outerr += cmsysProcess_GetExceptionString(cp);
- *output += outerr;
+ if(output)
+ {
+ *output += outerr;
+ }
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl
<< std::flush);
}
@@ -1430,7 +1438,10 @@ int cmCTest::RunTest(std::vector<const char*> argv,
{
std::string outerr = "\n*** ERROR executing: ";
outerr += cmsysProcess_GetErrorString(cp);
- *output += outerr;
+ if(output)
+ {
+ *output += outerr;
+ }
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl
<< std::flush);
}