summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 5cc0728..7be1d4c 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -3781,7 +3781,12 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
if(cmakeAndTest)
{
- return this->RunCMakeAndTest(output);
+ cmSystemTools::ResetErrorOccuredFlag();
+ cmListFileCache::GetInstance()->ClearCache();
+ int retv = this->RunCMakeAndTest(output);
+ cmSystemTools::ResetErrorOccuredFlag();
+ cmListFileCache::GetInstance()->ClearCache();
+ return retv;
}
int res;
@@ -3865,8 +3870,6 @@ void CMakeStdoutCallback(const char* m, int len, void* s)
int cmCTest::RunCMakeAndTest(std::string* outstring)
{
unsigned int k;
- cmSystemTools::ResetErrorOccuredFlag();
- cmListFileCache::GetInstance()->ClearCache();
std::string cmakeOutString;
cmSystemTools::SetErrorCallback(CMakeMessageCallback, &cmakeOutString);
cmSystemTools::SetStdoutCallback(CMakeStdoutCallback, &cmakeOutString);