ctest: Treat ENV{CTEST_OUTPUT_ON_FAILURE} as a boolean

Having this variable in the environment should not be enough to activate
the behavior.  It must also not be set to a false value (or empty value).
This commit is contained in:
Brad King 2015-04-22 08:27:19 -04:00
parent fcf9cf6cd8
commit b5b20d2050
1 changed files with 2 additions and 2 deletions

View File

@ -332,9 +332,9 @@ cmCTest::cmCTest()
this->ComputedCompressMemCheckOutput = false;
this->RepeatTests = 1; // default to run each test once
this->RepeatUntilFail = false;
if(cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE"))
if(const char* outOnFail = cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE"))
{
this->OutputTestOutputOnTestFailure = true;
this->OutputTestOutputOnTestFailure = !cmSystemTools::IsOff(outOnFail);
}
this->InitStreams();