ctest: Record --schedule-random seed in test log

Issue: #26760
Signed-off-by: Daniel Goldberg <daniel.goldberg@nextsilicon.com>
This commit is contained in:
Daniel Goldberg
2025-03-17 10:51:14 +02:00
committed by Brad King
parent 6639ac87b8
commit 3dc8e59bdc

View File

@@ -1324,7 +1324,12 @@ bool cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
bool randomSchedule = this->CTest->GetScheduleType() == "Random";
if (randomSchedule) {
srand(static_cast<unsigned>(time(nullptr)));
unsigned int seed = static_cast<unsigned>(time(nullptr));
srand(seed);
*this->LogFile
<< "Test order random seed: " << seed << std::endl
<< "----------------------------------------------------------"
<< std::endl;
}
for (cmCTestTestProperties& p : this->TestList) {