From 2871857dbf6a165e86208098caef2bff3f9720b4 Mon Sep 17 00:00:00 2001 From: Pawel Ksiezopolski Date: Tue, 15 Oct 2019 12:09:27 +0200 Subject: [PATCH] Fixed mandatory caselist for parallel CTS run Duplicate tests listed in deqp-fraction-mandatory-caselist-file command line option are now skipped during test tree parsing, when parallel CTS run is configured. Components: Framework VK-GL-CTS issue: 2053 Change-Id: I4ce2b6f33fd22c7ddc3aba0adbe9f7e761237e51 --- framework/common/tcuCommandLine.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/framework/common/tcuCommandLine.cpp b/framework/common/tcuCommandLine.cpp index 78bdb1f..bdb76ff 100644 --- a/framework/common/tcuCommandLine.cpp +++ b/framework/common/tcuCommandLine.cpp @@ -428,7 +428,7 @@ static void parseCaseTrie (CaseTreeNode* root, std::istream& in) } } -static void parseCaseList (CaseTreeNode* root, std::istream& in) +static void parseCaseList (CaseTreeNode* root, std::istream& in, bool reportDuplicates) { // \note Algorithm assumes that cases are sorted by groups, but will // function fine, albeit more slowly, if that is not the case. @@ -449,20 +449,22 @@ static void parseCaseList (CaseTreeNode* root, std::istream& in) if (curName.empty()) throw std::invalid_argument("Empty test case name"); - if (nodeStack[stackPos]->hasChild(curName)) - throw std::invalid_argument("Duplicate test case"); - - CaseTreeNode* const newChild = new CaseTreeNode(curName); - - try - { - nodeStack[stackPos]->addChild(newChild); - } - catch (...) + if (!nodeStack[stackPos]->hasChild(curName)) { - delete newChild; - throw; + CaseTreeNode* const newChild = new CaseTreeNode(curName); + + try + { + nodeStack[stackPos]->addChild(newChild); + } + catch (...) + { + delete newChild; + throw; + } } + else if (reportDuplicates) + throw std::invalid_argument("Duplicate test case"); curName.clear(); stackPos = 0; @@ -530,7 +532,7 @@ static CaseTreeNode* parseCaseList (std::istream& in) if (in.peek() == '{') parseCaseTrie(root, in); else - parseCaseList(root, in); + parseCaseList(root, in, true); { const int curChr = in.get(); @@ -1013,7 +1015,7 @@ CaseListFilter::CaseListFilter (const de::cmdline::CommandLine& cmdLine, const t { fileStream.clear(); fileStream.seekg(0, fileStream.beg); - parseCaseList(m_caseTree, fileStream); + parseCaseList(m_caseTree, fileStream, false); } } } -- 2.7.4