ctest: Cleanup for invalid argument handling

Backs out unrelated change and changes error message to 'Unknown argument'
This commit is contained in:
Martin Duffy
2024-04-16 16:12:27 -04:00
parent 70413d2c35
commit 96dbf6c34a
2 changed files with 5 additions and 5 deletions
+3 -4
View File
@@ -760,9 +760,7 @@ bool cmCTest::UpdateCTestConfiguration()
}
if (!this->GetCTestConfiguration("BuildDirectory").empty()) {
this->Impl->BinaryDir = this->GetCTestConfiguration("BuildDirectory");
if (this->Impl->TestDir.empty()) {
cmSystemTools::ChangeDirectory(this->Impl->BinaryDir);
}
cmSystemTools::ChangeDirectory(this->Impl->BinaryDir);
}
this->Impl->TimeOut =
std::chrono::seconds(atoi(this->GetCTestConfiguration("TimeOut").c_str()));
@@ -2830,7 +2828,8 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
if (!validArg && cmHasLiteralPrefix(arg, "-") &&
!cmHasLiteralPrefix(arg, "--preset")) {
cmSystemTools::Error(cmStrCat("Invalid argument: ", arg));
cmSystemTools::Error(cmStrCat("Unknown argument: ", arg));
cmSystemTools::Error("Run 'ctest --help' for all supported options.");
return 1;
}
} // the close of the for argument loop
@@ -1 +1,2 @@
CMake Error: Invalid argument: --not-a-valid-ctest-argument
CMake Error: Unknown argument: --not-a-valid-ctest-argument
CMake Error: Run 'ctest --help' for all supported options.