From 5969048d1dbd531902f187699e47754115274564 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 21 Apr 2017 09:31:36 -0400 Subject: cmCTestTestCommand: defer getting the global timeout --- Source/CTest/cmCTestTestCommand.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index a756188..21b1003 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -33,10 +33,11 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() const char* ctestTimeout = this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT"); - double timeout = this->CTest->GetTimeOut(); + double timeout; if (ctestTimeout) { timeout = atof(ctestTimeout); } else { + timeout = this->CTest->GetTimeOut(); if (timeout <= 0) { // By default use timeout of 10 minutes timeout = 600; -- cgit v0.12 From 3d1bd0111447909bec0582e8c0128a427a5eeaba Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 21 Apr 2017 09:50:04 -0400 Subject: cmCTestTestHandler: use pointers to static memory There's no need to reserve 100 bytes for each of these strings. --- Source/CTest/cmCTestTestHandler.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index dafeec2..167fecf 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1633,10 +1633,10 @@ void cmCTestTestHandler::UseExcludeRegExp() const char* cmCTestTestHandler::GetTestStatus(int status) { - static const char statuses[][100] = { - "Not Run", "Timeout", "SEGFAULT", "ILLEGAL", "INTERRUPT", - "NUMERICAL", "OTHER_FAULT", "Failed", "BAD_COMMAND", "Completed" - }; + static const char* statuses[] = { "Not Run", "Timeout", "SEGFAULT", + "ILLEGAL", "INTERRUPT", "NUMERICAL", + "OTHER_FAULT", "Failed", "BAD_COMMAND", + "Completed" }; if (status < cmCTestTestHandler::NOT_RUN || status > cmCTestTestHandler::COMPLETED) { -- cgit v0.12