diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index f594300529..2a2cb1cbff 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -694,6 +694,14 @@ void cmCTestRunTest::ComputeArguments() << (this->TestHandler->MemCheck ? "MemCheck" : "Test") << " command: " << testCommand << std::endl); + // Print any test-specific env vars in verbose mode + if (!this->TestProperties->Directory.empty()) { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + this->Index << ": " + << "Working Directory: " + << this->TestProperties->Directory << std::endl); + } + // Print any test-specific env vars in verbose mode if (!this->TestProperties->Environment.empty()) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 65f72c58fc..9ac42a6c7b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2999,7 +2999,7 @@ if(BUILD_TESTING) -C "\${CTestTest_CONFIG}" ) set_property(TEST CTestTestVerboseOutput PROPERTY PASS_REGULAR_EXPRESSION - "Environment variables:.*foo=bar.*this=that" + "Test command:.*Working Directory:.*Environment variables:.*foo=bar.*this=that" ) configure_file(