summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2015-03-15 17:00:31 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-17 14:11:33 (GMT)
commit874fdd914a646d25096c34b97caafe43e2a77748 (patch)
tree977f364db95e1200a4607777282a9d04511579a6 /Source/CTest
parent607131bf8c806b6227e56089eab9252537bd31d8 (diff)
downloadCMake-874fdd914a646d25096c34b97caafe43e2a77748.zip
CMake-874fdd914a646d25096c34b97caafe43e2a77748.tar.gz
CMake-874fdd914a646d25096c34b97caafe43e2a77748.tar.bz2
CTest: Output test-specific env vars in verbose mode (#15446)
Any environment vars that were configured for a test via the ENVIRONMENT property will now be output when the test is run with verbose logging enabled.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 03131fd..01a7884 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -536,11 +536,26 @@ void cmCTestRunTest::ComputeArguments()
}
this->TestResult.FullCommandLine = testCommand;
+ // Print the test command in verbose mode
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
<< this->Index << ": "
<< (this->TestHandler->MemCheck?"MemCheck":"Test")
<< " command: " << testCommand
<< std::endl);
+
+ // Print any test-specific env vars in verbose mode
+ if (this->TestProperties->Environment.size())
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": "
+ << "Environment variables: " << std::endl);
+ }
+ for(std::vector<std::string>::const_iterator e =
+ this->TestProperties->Environment.begin();
+ e != this->TestProperties->Environment.end(); ++e)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": " << *e
+ << std::endl);
+ }
}
//----------------------------------------------------------------------