Fixed mandatory caselist for parallel CTS run
authorPawel Ksiezopolski <pawel.ksiezopolski@mobica.com>
Tue, 15 Oct 2019 10:09:27 +0000 (12:09 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 15 Oct 2019 11:50:53 +0000 (07:50 -0400)
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

index 78bdb1f..bdb76ff 100644 (file)
@@ -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);
                                }
                        }
                }