diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2cd60e5b88..ed45644ff3 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1131,6 +1131,7 @@ int cmCTest::RunTest(std::vector argv, std::string* output, // invocations. Since --build-generator is required this is a // good place to check for it, and to add the arguments in if (strcmp(i, "--build-generator") == 0 && + timeout != std::chrono::duration::max() && timeout > std::chrono::duration::zero()) { args.push_back("--test-timeout"); std::ostringstream msg;