From d4e3804f4e3edf6c3f557274b6e392d29c3a3be9 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Fri, 16 Jan 2004 14:00:30 -0500 Subject: [PATCH] fix so that ctest is run even with bad cmake result --- Source/cmCTest.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 69c5112ed..0b89e2d26 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -3056,7 +3056,7 @@ int cmCTest::RunConfigurationScript() int retVal = 0; bool res; - // do an initial cvs update on the src dir + // do an initial cvs update as required const char *cvsCmd = mf->GetDefinition("CTEST_CVS_COMMAND"); if (cvsCmd) { @@ -3114,6 +3114,7 @@ int cmCTest::RunConfigurationScript() // do an initial cmake to setup the DartConfig file const char *cmakeCmd = mf->GetDefinition("CTEST_CMAKE_COMMAND"); + int cmakeFailed = 0; if (cmakeCmd) { command = cmakeCmd; @@ -3127,8 +3128,8 @@ int cmCTest::RunConfigurationScript() m_Verbose, 0 /*m_TimeOut*/); if (!res || retVal != 0) { - cmSystemTools::Error("Unable to run cmake"); - return -7; + // even if this fails continue to the next step + cmakeFailed = 1; } } @@ -3141,7 +3142,7 @@ int cmCTest::RunConfigurationScript() m_Verbose, 0 /*m_TimeOut*/); // did something critical fail in ctest - if (!res || + if (!res || cmakeFailed || retVal & CTEST_BUILD_ERRORS) { // if we backed up the dirs and the build failed, then restore @@ -3161,6 +3162,11 @@ int cmCTest::RunConfigurationScript() rename(backupSrcDir.c_str(), srcDir); rename(backupBinDir.c_str(), binDir); } + if (cmakeFailed) + { + cmSystemTools::Error("Unable to run cmake"); + return -7; + } cmSystemTools::Error("Unable to run ctest"); if (!res) {