Add list of tests for each fraction of CTS parallel run
authorPawel Ksiezopolski <pawel.ksiezopolski@mobica.com>
Thu, 12 Sep 2019 07:25:57 +0000 (09:25 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 29 Oct 2019 10:58:20 +0000 (06:58 -0400)
The tests may be split in groups for parallel execution
using commandline deqp-fraction parameter.
This commit adds possibility to perform a list of tests
for each such fraction.
To achieve this - user must use parameter
deqp-fraction-mandatory-caselist-file defining a file with
a list of tests. File vk-fraction-mandatory-tests.txt
defines a list of mandatory tests when parallel execution
is applied.

Components: Vulkan Framework

VK-GL-CTS issue: 1897

Change-Id: I684eb07c24bbf3aeaf3386f205658dfe07b9fe25
(cherry picked from commit e93d85372840151db6833bfdebed30d4eca98d8d)

external/vulkancts/mustpass/AndroidTest.xml
external/vulkancts/mustpass/master/src/fraction-mandatory-tests.txt [new file with mode: 0644]
external/vulkancts/mustpass/master/vk-fraction-mandatory-tests.txt [new file with mode: 0644]
external/vulkancts/scripts/build_mustpass.py
framework/common/tcuCommandLine.cpp
framework/common/tcuCommandLine.hpp
framework/common/tcuTestHierarchyIterator.cpp
scripts/mustpass.py

index 71ba707..c125fe5 100644 (file)
@@ -30,4 +30,8 @@
                <option name="deqp-package" value="dEQP-VK"/>
                <option name="deqp-caselist-file" value="vk-default-no-waivers.txt"/>
        </test>
+       <test class="com.drawelements.deqp.runner.DeqpTestRunner">
+               <option name="deqp-package" value="dEQP-VK"/>
+               <option name="deqp-caselist-file" value="vk-fraction-mandatory-tests.txt"/>
+       </test>
 </configuration>
diff --git a/external/vulkancts/mustpass/master/src/fraction-mandatory-tests.txt b/external/vulkancts/mustpass/master/src/fraction-mandatory-tests.txt
new file mode 100644 (file)
index 0000000..9aa9167
--- /dev/null
@@ -0,0 +1 @@
+dEQP-VK.info.*
diff --git a/external/vulkancts/mustpass/master/vk-fraction-mandatory-tests.txt b/external/vulkancts/mustpass/master/vk-fraction-mandatory-tests.txt
new file mode 100644 (file)
index 0000000..8161969
--- /dev/null
@@ -0,0 +1,18 @@
+dEQP-VK.info.build
+dEQP-VK.info.device
+dEQP-VK.info.platform
+dEQP-VK.info.memory_limits
+dEQP-VK.info.physical_devices
+dEQP-VK.info.physical_device_groups
+dEQP-VK.info.instance_layers
+dEQP-VK.info.instance_extensions
+dEQP-VK.info.device_features
+dEQP-VK.info.device_properties
+dEQP-VK.info.device_queue_family_properties
+dEQP-VK.info.device_memory_properties
+dEQP-VK.info.device_layers
+dEQP-VK.info.device_extensions
+dEQP-VK.info.device_no_khx_extensions
+dEQP-VK.info.device_memory_budget
+dEQP-VK.info.device_mandatory_features
+dEQP-VK.info.device_group_peer_memory_features
index a4e7159..5702d42 100644 (file)
@@ -64,6 +64,8 @@ VULKAN_MASTER_PKG     = Package(module = VULKAN_MODULE, configurations = [
                                                                           exclude("test-issues.txt"),
                                                                           exclude("excluded-tests.txt"),
                                                                           exclude("android-tests.txt")]),
+                 Configuration(name            = "fraction-mandatory-tests",
+                                               filters         = [include("fraction-mandatory-tests.txt")]),
         ])
 
 MUSTPASS_LISTS         = [
@@ -71,4 +73,4 @@ MUSTPASS_LISTS                = [
        ]
 
 if __name__ == "__main__":
-       genMustpassLists(MUSTPASS_LISTS, ANY_GENERATOR, parseBuildConfigFromCmdLineArgs())
+       genMustpassLists(MUSTPASS_LISTS, ANY_GENERATOR, parseBuildConfigFromCmdLineArgs())
\ No newline at end of file
index 2f6d68f..78bdb1f 100644 (file)
@@ -38,6 +38,7 @@
 #include <sstream>
 #include <fstream>
 #include <iostream>
+#include <algorithm>
 
 using std::string;
 using std::vector;
@@ -96,6 +97,7 @@ DE_DECLARE_COMMAND_LINE_OPT(OptimizeSpirv,                            bool);
 DE_DECLARE_COMMAND_LINE_OPT(ShaderCacheTruncate,               bool);
 DE_DECLARE_COMMAND_LINE_OPT(RenderDoc,                                 bool);
 DE_DECLARE_COMMAND_LINE_OPT(CaseFraction,                              std::vector<int>);
+DE_DECLARE_COMMAND_LINE_OPT(CaseFractionMandatoryTests,        std::string);
 
 static void parseIntList (const char* src, std::vector<int>* dst)
 {
@@ -150,48 +152,49 @@ void registerOptions (de::cmdline::Parser& parser)
        };
 
        parser
-               << Option<CasePath>                             ("n",           "deqp-case",                                    "Test case(s) to run, supports wildcards (e.g. dEQP-GLES2.info.*)")
-               << Option<CaseList>                             (DE_NULL,       "deqp-caselist",                                "Case list to run in trie format (e.g. {dEQP-GLES2{info{version,renderer}}})")
-               << Option<CaseListFile>                 (DE_NULL,       "deqp-caselist-file",                   "Read case list (in trie format) from given file")
-               << Option<CaseListResource>             (DE_NULL,       "deqp-caselist-resource",               "Read case list (in trie format) from given file located application's assets")
-               << Option<StdinCaseList>                (DE_NULL,       "deqp-stdin-caselist",                  "Read case list (in trie format) from stdin")
-               << Option<LogFilename>                  (DE_NULL,       "deqp-log-filename",                    "Write test results to given file",                                     "TestResults.qpa")
-               << Option<RunMode>                              (DE_NULL,       "deqp-runmode",                                 "Execute tests, or write list of test cases into a file",
-                                                                                                                                                                                                                                                                               s_runModes,                     "execute")
-               << Option<ExportFilenamePattern>(DE_NULL,       "deqp-caselist-export-file",    "Set the target file name pattern for caselist export",                                 "${packageName}-cases.${typeExtension}")
-               << Option<WatchDog>                             (DE_NULL,       "deqp-watchdog",                                "Enable test watchdog",                                                         s_enableNames,          "disable")
-               << Option<CrashHandler>                 (DE_NULL,       "deqp-crashhandler",                    "Enable crash handling",                                                        s_enableNames,          "disable")
-               << Option<BaseSeed>                             (DE_NULL,       "deqp-base-seed",                               "Base seed for test cases that use randomization",                                              "0")
-               << Option<TestIterationCount>   (DE_NULL,       "deqp-test-iteration-count",    "Iteration count for cases that support variable number of iterations", "0")
-               << Option<Visibility>                   (DE_NULL,       "deqp-visibility",                              "Default test window visibility",                                       s_visibilites,          "windowed")
-               << Option<SurfaceWidth>                 (DE_NULL,       "deqp-surface-width",                   "Use given surface width if possible",                                                                  "-1")
-               << Option<SurfaceHeight>                (DE_NULL,       "deqp-surface-height",                  "Use given surface height if possible",                                                                 "-1")
-               << Option<SurfaceType>                  (DE_NULL,       "deqp-surface-type",                    "Use given surface type",                                                       s_surfaceTypes,         "window")
-               << Option<ScreenRotation>               (DE_NULL,       "deqp-screen-rotation",                 "Screen rotation for platforms that support it",        s_screenRotations,      "0")
-               << Option<GLContextType>                (DE_NULL,       "deqp-gl-context-type",                 "OpenGL context type for platforms that support multiple")
-               << Option<GLConfigID>                   (DE_NULL,       "deqp-gl-config-id",                    "OpenGL (ES) render config ID (EGL config id on EGL platforms)",                "-1")
-               << Option<GLConfigName>                 (DE_NULL,       "deqp-gl-config-name",                  "Symbolic OpenGL (ES) render config name")
-               << Option<GLContextFlags>               (DE_NULL,       "deqp-gl-context-flags",                "OpenGL context flags (comma-separated, supports debug and robust)")
-               << Option<CLPlatformID>                 (DE_NULL,       "deqp-cl-platform-id",                  "Execute tests on given OpenCL platform (IDs start from 1)",                    "1")
-               << Option<CLDeviceIDs>                  (DE_NULL,       "deqp-cl-device-ids",                   "Execute tests on given CL devices (comma-separated, IDs start from 1)",        parseIntList,   "")
-               << Option<CLBuildOptions>               (DE_NULL,       "deqp-cl-build-options",                "Extra build options for OpenCL compiler")
-               << Option<EGLDisplayType>               (DE_NULL,       "deqp-egl-display-type",                "EGL native display type")
-               << Option<EGLWindowType>                (DE_NULL,       "deqp-egl-window-type",                 "EGL native window type")
-               << Option<EGLPixmapType>                (DE_NULL,       "deqp-egl-pixmap-type",                 "EGL native pixmap type")
-               << Option<VKDeviceID>                   (DE_NULL,       "deqp-vk-device-id",                    "Vulkan device ID (IDs start from 1)",                                                                  "1")
-               << Option<VKDeviceGroupID>              (DE_NULL,       "deqp-vk-device-group-id",              "Vulkan device Group ID (IDs start from 1)",                                                    "1")
-               << Option<LogImages>                    (DE_NULL,       "deqp-log-images",                              "Enable or disable logging of result images",           s_enableNames,          "enable")
-               << Option<LogShaderSources>             (DE_NULL,       "deqp-log-shader-sources",              "Enable or disable logging of shader sources",          s_enableNames,          "enable")
-               << Option<TestOOM>                              (DE_NULL,       "deqp-test-oom",                                "Run tests that exhaust memory on purpose",                     s_enableNames,          TEST_OOM_DEFAULT)
-               << Option<LogFlush>                             (DE_NULL,       "deqp-log-flush",                               "Enable or disable log file fflush",                            s_enableNames,          "enable")
-               << Option<Validation>                   (DE_NULL,       "deqp-validation",                              "Enable or disable test case validation",                       s_enableNames,          "disable")
-               << Option<Optimization>                 (DE_NULL,       "deqp-optimization-recipe",             "Shader optimization recipe (0=disabled, 1=performance, 2=size)",               "0")
-               << Option<OptimizeSpirv>                (DE_NULL,       "deqp-optimize-spirv",                  "Apply optimization to spir-v shaders as well",         s_enableNames,          "disable")
-               << Option<ShaderCache>                  (DE_NULL,       "deqp-shadercache",                             "Enable or disable shader cache",                                       s_enableNames,          "enable")
-               << Option<ShaderCacheFilename>  (DE_NULL,       "deqp-shadercache-filename",    "Write shader cache to given file",                                                                             "shadercache.bin")
-               << Option<ShaderCacheTruncate>  (DE_NULL,       "deqp-shadercache-truncate",    "Truncate shader cache before running tests",           s_enableNames,          "enable")
-               << Option<RenderDoc>                    (DE_NULL,       "deqp-renderdoc",                               "Enable RenderDoc frame markers",                                       s_enableNames,          "disable")
-               << Option<CaseFraction>                 (DE_NULL,       "deqp-case-fraction",                   "Run a fraction of the test cases (e.g. N,M means run group%M==N)",     parseIntList,   "");
+               << Option<CasePath>                                             ("n",           "deqp-case",                                                            "Test case(s) to run, supports wildcards (e.g. dEQP-GLES2.info.*)")
+               << Option<CaseList>                                             (DE_NULL,       "deqp-caselist",                                                        "Case list to run in trie format (e.g. {dEQP-GLES2{info{version,renderer}}})")
+               << Option<CaseListFile>                                 (DE_NULL,       "deqp-caselist-file",                                           "Read case list (in trie format) from given file")
+               << Option<CaseListResource>                             (DE_NULL,       "deqp-caselist-resource",                                       "Read case list (in trie format) from given file located application's assets")
+               << Option<StdinCaseList>                                (DE_NULL,       "deqp-stdin-caselist",                                          "Read case list (in trie format) from stdin")
+               << Option<LogFilename>                                  (DE_NULL,       "deqp-log-filename",                                            "Write test results to given file",                                     "TestResults.qpa")
+               << Option<RunMode>                                              (DE_NULL,       "deqp-runmode",                                                         "Execute tests, or write list of test cases into a file",
+                                                                                                                                                                                                                                                                                                                       s_runModes,                     "execute")
+               << Option<ExportFilenamePattern>                (DE_NULL,       "deqp-caselist-export-file",                            "Set the target file name pattern for caselist export",                                 "${packageName}-cases.${typeExtension}")
+               << Option<WatchDog>                                             (DE_NULL,       "deqp-watchdog",                                                        "Enable test watchdog",                                                         s_enableNames,          "disable")
+               << Option<CrashHandler>                                 (DE_NULL,       "deqp-crashhandler",                                            "Enable crash handling",                                                        s_enableNames,          "disable")
+               << Option<BaseSeed>                                             (DE_NULL,       "deqp-base-seed",                                                       "Base seed for test cases that use randomization",                                              "0")
+               << Option<TestIterationCount>                   (DE_NULL,       "deqp-test-iteration-count",                            "Iteration count for cases that support variable number of iterations", "0")
+               << Option<Visibility>                                   (DE_NULL,       "deqp-visibility",                                                      "Default test window visibility",                                       s_visibilites,          "windowed")
+               << Option<SurfaceWidth>                                 (DE_NULL,       "deqp-surface-width",                                           "Use given surface width if possible",                                                                  "-1")
+               << Option<SurfaceHeight>                                (DE_NULL,       "deqp-surface-height",                                          "Use given surface height if possible",                                                                 "-1")
+               << Option<SurfaceType>                                  (DE_NULL,       "deqp-surface-type",                                            "Use given surface type",                                                       s_surfaceTypes,         "window")
+               << Option<ScreenRotation>                               (DE_NULL,       "deqp-screen-rotation",                                         "Screen rotation for platforms that support it",        s_screenRotations,      "0")
+               << Option<GLContextType>                                (DE_NULL,       "deqp-gl-context-type",                                         "OpenGL context type for platforms that support multiple")
+               << Option<GLConfigID>                                   (DE_NULL,       "deqp-gl-config-id",                                            "OpenGL (ES) render config ID (EGL config id on EGL platforms)",                "-1")
+               << Option<GLConfigName>                                 (DE_NULL,       "deqp-gl-config-name",                                          "Symbolic OpenGL (ES) render config name")
+               << Option<GLContextFlags>                               (DE_NULL,       "deqp-gl-context-flags",                                        "OpenGL context flags (comma-separated, supports debug and robust)")
+               << Option<CLPlatformID>                                 (DE_NULL,       "deqp-cl-platform-id",                                          "Execute tests on given OpenCL platform (IDs start from 1)",                    "1")
+               << Option<CLDeviceIDs>                                  (DE_NULL,       "deqp-cl-device-ids",                                           "Execute tests on given CL devices (comma-separated, IDs start from 1)",        parseIntList,   "")
+               << Option<CLBuildOptions>                               (DE_NULL,       "deqp-cl-build-options",                                        "Extra build options for OpenCL compiler")
+               << Option<EGLDisplayType>                               (DE_NULL,       "deqp-egl-display-type",                                        "EGL native display type")
+               << Option<EGLWindowType>                                (DE_NULL,       "deqp-egl-window-type",                                         "EGL native window type")
+               << Option<EGLPixmapType>                                (DE_NULL,       "deqp-egl-pixmap-type",                                         "EGL native pixmap type")
+               << Option<VKDeviceID>                                   (DE_NULL,       "deqp-vk-device-id",                                            "Vulkan device ID (IDs start from 1)",                                                                  "1")
+               << Option<VKDeviceGroupID>                              (DE_NULL,       "deqp-vk-device-group-id",                                      "Vulkan device Group ID (IDs start from 1)",                                                    "1")
+               << Option<LogImages>                                    (DE_NULL,       "deqp-log-images",                                                      "Enable or disable logging of result images",           s_enableNames,          "enable")
+               << Option<LogShaderSources>                             (DE_NULL,       "deqp-log-shader-sources",                                      "Enable or disable logging of shader sources",          s_enableNames,          "enable")
+               << Option<TestOOM>                                              (DE_NULL,       "deqp-test-oom",                                                        "Run tests that exhaust memory on purpose",                     s_enableNames,          TEST_OOM_DEFAULT)
+               << Option<LogFlush>                                             (DE_NULL,       "deqp-log-flush",                                                       "Enable or disable log file fflush",                            s_enableNames,          "enable")
+               << Option<Validation>                                   (DE_NULL,       "deqp-validation",                                                      "Enable or disable test case validation",                       s_enableNames,          "disable")
+               << Option<Optimization>                                 (DE_NULL,       "deqp-optimization-recipe",                                     "Shader optimization recipe (0=disabled, 1=performance, 2=size)",               "0")
+               << Option<OptimizeSpirv>                                (DE_NULL,       "deqp-optimize-spirv",                                          "Apply optimization to spir-v shaders as well",         s_enableNames,          "disable")
+               << Option<ShaderCache>                                  (DE_NULL,       "deqp-shadercache",                                                     "Enable or disable shader cache",                                       s_enableNames,          "enable")
+               << Option<ShaderCacheFilename>                  (DE_NULL,       "deqp-shadercache-filename",                            "Write shader cache to given file",                                                                             "shadercache.bin")
+               << Option<ShaderCacheTruncate>                  (DE_NULL,       "deqp-shadercache-truncate",                            "Truncate shader cache before running tests",           s_enableNames,          "enable")
+               << Option<RenderDoc>                                    (DE_NULL,       "deqp-renderdoc",                                                       "Enable RenderDoc frame markers",                                       s_enableNames,          "disable")
+               << Option<CaseFraction>                                 (DE_NULL,       "deqp-fraction",                                                        "Run a fraction of the test cases (e.g. N,M means run group%M==N)",     parseIntList,   "")
+               << Option<CaseFractionMandatoryTests>   (DE_NULL,       "deqp-fraction-mandatory-caselist-file",        "Case list file that must be run for each fraction",                                    "");
 }
 
 void registerLegacyOptions (de::cmdline::Parser& parser)
@@ -548,6 +551,7 @@ class CasePaths
 {
 public:
                                                        CasePaths       (const string& pathList);
+                                                       CasePaths       (const vector<string>& pathList);
        bool                                    matches         (const string& caseName, bool allowPrefix=false) const;
 
 private:
@@ -559,6 +563,11 @@ CasePaths::CasePaths (const string& pathList)
 {
 }
 
+CasePaths::CasePaths(const vector<string>& pathList)
+       : m_casePatterns(pathList)
+{
+}
+
 // Match a single path component against a pattern component that may contain *-wildcards.
 static bool matchWildcards(string::const_iterator      patternStart,
                                                   string::const_iterator       patternEnd,
@@ -785,33 +794,34 @@ bool CommandLine::parse (const std::string& cmdLine)
        return isOk;
 }
 
-const char*                            CommandLine::getLogFileName                                     (void) const    { return m_cmdLine.getOption<opt::LogFilename>().c_str();                       }
-deUint32                               CommandLine::getLogFlags                                        (void) const    { return m_logFlags;                                                                                            }
-RunMode                                        CommandLine::getRunMode                                         (void) const    { return m_cmdLine.getOption<opt::RunMode>();                                           }
-const char*                            CommandLine::getCaseListExportFile                      (void) const    { return m_cmdLine.getOption<opt::ExportFilenamePattern>().c_str();     }
-WindowVisibility               CommandLine::getVisibility                                      (void) const    { return m_cmdLine.getOption<opt::Visibility>();                                        }
-bool                                   CommandLine::isWatchDogEnabled                          (void) const    { return m_cmdLine.getOption<opt::WatchDog>();                                          }
-bool                                   CommandLine::isCrashHandlingEnabled                     (void) const    { return m_cmdLine.getOption<opt::CrashHandler>();                                      }
-int                                            CommandLine::getBaseSeed                                        (void) const    { return m_cmdLine.getOption<opt::BaseSeed>();                                          }
-int                                            CommandLine::getTestIterationCount                      (void) const    { return m_cmdLine.getOption<opt::TestIterationCount>();                        }
-int                                            CommandLine::getSurfaceWidth                            (void) const    { return m_cmdLine.getOption<opt::SurfaceWidth>();                                      }
-int                                            CommandLine::getSurfaceHeight                           (void) const    { return m_cmdLine.getOption<opt::SurfaceHeight>();                                     }
-SurfaceType                            CommandLine::getSurfaceType                                     (void) const    { return m_cmdLine.getOption<opt::SurfaceType>();                                       }
-ScreenRotation                 CommandLine::getScreenRotation                          (void) const    { return m_cmdLine.getOption<opt::ScreenRotation>();                            }
-int                                            CommandLine::getGLConfigId                                      (void) const    { return m_cmdLine.getOption<opt::GLConfigID>();                                        }
-int                                            CommandLine::getCLPlatformId                            (void) const    { return m_cmdLine.getOption<opt::CLPlatformID>();                                      }
-const std::vector<int>&        CommandLine::getCLDeviceIds                                     (void) const    { return m_cmdLine.getOption<opt::CLDeviceIDs>();                                       }
-int                                            CommandLine::getVKDeviceId                                      (void) const    { return m_cmdLine.getOption<opt::VKDeviceID>();                                        }
-int                                            CommandLine::getVKDeviceGroupId                         (void) const    { return m_cmdLine.getOption<opt::VKDeviceGroupID>();                           }
-bool                                   CommandLine::isValidationEnabled                        (void) const    { return m_cmdLine.getOption<opt::Validation>();                                        }
-bool                                   CommandLine::isOutOfMemoryTestEnabled           (void) const    { return m_cmdLine.getOption<opt::TestOOM>();                                           }
-bool                                   CommandLine::isShadercacheEnabled                       (void) const    { return m_cmdLine.getOption<opt::ShaderCache>();                                       }
-const char*                            CommandLine::getShaderCacheFilename                     (void) const    { return m_cmdLine.getOption<opt::ShaderCacheFilename>().c_str();       }
-bool                                   CommandLine::isShaderCacheTruncateEnabled       (void) const    { return m_cmdLine.getOption<opt::ShaderCacheTruncate>();                       }
-int                                            CommandLine::getOptimizationRecipe                      (void) const    { return m_cmdLine.getOption<opt::Optimization>();                                      }
-bool                                   CommandLine::isSpirvOptimizationEnabled         (void) const    { return m_cmdLine.getOption<opt::OptimizeSpirv>();                                     }
-bool                                   CommandLine::isRenderDocEnabled                         (void) const    { return m_cmdLine.getOption<opt::RenderDoc>();                                         }
-const std::vector<int>&        CommandLine::getCaseFraction                            (void) const    { return m_cmdLine.getOption<opt::CaseFraction>();                                      }
+const char*                            CommandLine::getLogFileName                                     (void) const    { return m_cmdLine.getOption<opt::LogFilename>().c_str();                                       }
+deUint32                               CommandLine::getLogFlags                                        (void) const    { return m_logFlags;                                                                                                            }
+RunMode                                        CommandLine::getRunMode                                         (void) const    { return m_cmdLine.getOption<opt::RunMode>();                                                           }
+const char*                            CommandLine::getCaseListExportFile                      (void) const    { return m_cmdLine.getOption<opt::ExportFilenamePattern>().c_str();                     }
+WindowVisibility               CommandLine::getVisibility                                      (void) const    { return m_cmdLine.getOption<opt::Visibility>();                                                        }
+bool                                   CommandLine::isWatchDogEnabled                          (void) const    { return m_cmdLine.getOption<opt::WatchDog>();                                                          }
+bool                                   CommandLine::isCrashHandlingEnabled                     (void) const    { return m_cmdLine.getOption<opt::CrashHandler>();                                                      }
+int                                            CommandLine::getBaseSeed                                        (void) const    { return m_cmdLine.getOption<opt::BaseSeed>();                                                          }
+int                                            CommandLine::getTestIterationCount                      (void) const    { return m_cmdLine.getOption<opt::TestIterationCount>();                                        }
+int                                            CommandLine::getSurfaceWidth                            (void) const    { return m_cmdLine.getOption<opt::SurfaceWidth>();                                                      }
+int                                            CommandLine::getSurfaceHeight                           (void) const    { return m_cmdLine.getOption<opt::SurfaceHeight>();                                                     }
+SurfaceType                            CommandLine::getSurfaceType                                     (void) const    { return m_cmdLine.getOption<opt::SurfaceType>();                                                       }
+ScreenRotation                 CommandLine::getScreenRotation                          (void) const    { return m_cmdLine.getOption<opt::ScreenRotation>();                                            }
+int                                            CommandLine::getGLConfigId                                      (void) const    { return m_cmdLine.getOption<opt::GLConfigID>();                                                        }
+int                                            CommandLine::getCLPlatformId                            (void) const    { return m_cmdLine.getOption<opt::CLPlatformID>();                                                      }
+const std::vector<int>&        CommandLine::getCLDeviceIds                                     (void) const    { return m_cmdLine.getOption<opt::CLDeviceIDs>();                                                       }
+int                                            CommandLine::getVKDeviceId                                      (void) const    { return m_cmdLine.getOption<opt::VKDeviceID>();                                                        }
+int                                            CommandLine::getVKDeviceGroupId                         (void) const    { return m_cmdLine.getOption<opt::VKDeviceGroupID>();                                           }
+bool                                   CommandLine::isValidationEnabled                        (void) const    { return m_cmdLine.getOption<opt::Validation>();                                                        }
+bool                                   CommandLine::isOutOfMemoryTestEnabled           (void) const    { return m_cmdLine.getOption<opt::TestOOM>();                                                           }
+bool                                   CommandLine::isShadercacheEnabled                       (void) const    { return m_cmdLine.getOption<opt::ShaderCache>();                                                       }
+const char*                            CommandLine::getShaderCacheFilename                     (void) const    { return m_cmdLine.getOption<opt::ShaderCacheFilename>().c_str();                       }
+bool                                   CommandLine::isShaderCacheTruncateEnabled       (void) const    { return m_cmdLine.getOption<opt::ShaderCacheTruncate>();                                       }
+int                                            CommandLine::getOptimizationRecipe                      (void) const    { return m_cmdLine.getOption<opt::Optimization>();                                                      }
+bool                                   CommandLine::isSpirvOptimizationEnabled         (void) const    { return m_cmdLine.getOption<opt::OptimizeSpirv>();                                                     }
+bool                                   CommandLine::isRenderDocEnabled                         (void) const    { return m_cmdLine.getOption<opt::RenderDoc>();                                                         }
+const std::vector<int>&        CommandLine::getCaseFraction                            (void) const    { return m_cmdLine.getOption<opt::CaseFraction>();                                                      }
+const char*                            CommandLine::getCaseFractionMandatoryTests      (void) const    { return m_cmdLine.getOption<opt::CaseFractionMandatoryTests>().c_str();        }
 
 const char* CommandLine::getGLContextType (void) const
 {
@@ -887,22 +897,37 @@ de::MovePtr<CaseListFilter> CommandLine::createCaseListFilter (const tcu::Archiv
 
 bool CaseListFilter::checkTestGroupName (const char* groupName) const
 {
+       bool result = false;
        if (m_casePaths)
-               return m_casePaths->matches(groupName, true);
+               result = m_casePaths->matches(groupName, true);
        else if (m_caseTree)
-               return groupName[0] == 0 || tcu::checkTestGroupName(m_caseTree, groupName);
+               result = ( groupName[0] == 0 || tcu::checkTestGroupName(m_caseTree, groupName) );
        else
                return true;
+       if (!result && m_caseFractionMandatoryTests.get() != DE_NULL)
+               result = m_caseFractionMandatoryTests->matches(groupName, true);
+       return result;
 }
 
 bool CaseListFilter::checkTestCaseName (const char* caseName) const
 {
+       bool result = false;
        if (m_casePaths)
-               return m_casePaths->matches(caseName, false);
+               result = m_casePaths->matches(caseName, false);
        else if (m_caseTree)
-               return tcu::checkTestCaseName(m_caseTree, caseName);
+               result = tcu::checkTestCaseName(m_caseTree, caseName);
        else
                return true;
+       if (!result && m_caseFractionMandatoryTests.get() != DE_NULL)
+               result = m_caseFractionMandatoryTests->matches(caseName, false);
+       return result;
+}
+
+bool CaseListFilter::checkCaseFraction (int i, const std::string& testCaseName) const
+{
+       return  m_caseFraction.size() != 2 ||
+               ((i % m_caseFraction[1]) == m_caseFraction[0]) ||
+               (m_caseFractionMandatoryTests.get()!=DE_NULL && m_caseFractionMandatoryTests->matches(testCaseName));
 }
 
 CaseListFilter::CaseListFilter (void)
@@ -957,11 +982,42 @@ CaseListFilter::CaseListFilter (const de::cmdline::CommandLine& cmdLine, const t
        m_caseFraction = cmdLine.getOption<opt::CaseFraction>();
 
        if (m_caseFraction.size() == 2 &&
-               (m_caseFraction[0] < 0 || m_caseFraction[1] <= 0 || m_caseFraction[0] >= m_caseFraction[1]))
-               throw Exception("Invalid case fraction. First element must be less than second element. Second element must be positive. First element must be non-negative.");
+               (m_caseFraction[0] < 0 || m_caseFraction[1] <= 0 || m_caseFraction[0] >= m_caseFraction[1] ))
+               throw Exception("Invalid case fraction. First element must be non-negative and less than second element. Second element must be greater than 0.");
 
        if (m_caseFraction.size() != 0 && m_caseFraction.size() != 2)
                throw Exception("Invalid case fraction. Must have two components.");
+
+       if (m_caseFraction.size() == 2)
+       {
+               std::string                                     caseFractionMandatoryTestsFilename = cmdLine.getOption<opt::CaseFractionMandatoryTests>();
+
+               if (!caseFractionMandatoryTestsFilename.empty())
+               {
+                       std::ifstream fileStream(caseFractionMandatoryTestsFilename.c_str(), std::ios_base::binary);
+                       if (!fileStream.is_open() || !fileStream.good())
+                               throw Exception("Failed to open case fraction mandatory test list: '" + caseFractionMandatoryTestsFilename + "'");
+
+                       std::vector<std::string>        cfPaths;
+                       std::string                                     line;
+
+                       while (std::getline(fileStream, line))
+                       {
+                               line.erase(std::remove(std::begin(line), std::end(line), '\r'), std::end(line));
+                               cfPaths.push_back(line);
+                       }
+                       if (!cfPaths.empty())
+                       {
+                               m_caseFractionMandatoryTests = de::MovePtr<const CasePaths>(new CasePaths(cfPaths));
+                               if (m_caseTree != DE_NULL)
+                               {
+                                       fileStream.clear();
+                                       fileStream.seekg(0, fileStream.beg);
+                                       parseCaseList(m_caseTree, fileStream);
+                               }
+                       }
+               }
+       }
 }
 
 CaseListFilter::~CaseListFilter (void)
index a5f513d..a7cb3ab 100644 (file)
@@ -105,10 +105,7 @@ public:
        bool                                                    checkTestCaseName                       (const char* caseName) const;
 
        //! Check if test group passes the case fraction filter.
-       bool                                                    checkCaseFraction                       (int i) const {
-               return m_caseFraction.size() != 2 ||
-                          ((i % m_caseFraction[1]) == m_caseFraction[0]);
-       }
+       bool                                                    checkCaseFraction                       (int i, const std::string& testCaseName) const;
 
 private:
        CaseListFilter                                                                                          (const CaseListFilter&);        // not allowed!
@@ -117,6 +114,7 @@ private:
        CaseTreeNode*                                   m_caseTree;
        de::MovePtr<const CasePaths>    m_casePaths;
        std::vector<int>                                m_caseFraction;
+       de::MovePtr<const CasePaths>    m_caseFractionMandatoryTests;
 };
 
 /*--------------------------------------------------------------------*//*!
@@ -239,6 +237,9 @@ public:
        //! Get case list fraction
        const std::vector<int>&                 getCaseFraction                         (void) const;
 
+       //! Get must-list filename
+       const char*                                             getCaseFractionMandatoryTests(void) const;
+
        /*--------------------------------------------------------------------*//*!
         * \brief Creates case list filter
         * \param archive Resources
index 0ae91ee..1fbb662 100644 (file)
@@ -219,9 +219,11 @@ void TestHierarchyIterator::next (void)
 
                                        // Check whether this is a bottom-level group (child is executable)
                                        // and whether that group should be filtered out.
-                                       if (isTestNodeTypeExecutable(childNode->getNodeType()) &&
-                                               !m_caseListFilter.checkCaseFraction(m_groupNumber)) {
-                                               break;
+                                       if ( isTestNodeTypeExecutable(childNode->getNodeType()) )
+                                       {
+                                               const std::string testName = m_nodePath + "." + childNode->getName();
+                                               if(!m_caseListFilter.checkCaseFraction(m_groupNumber, testName))
+                                                       break;
                                        }
                                        m_sessionStack.push_back(NodeIter(childNode));
                                }
index 8fc69c7..12949db 100644 (file)
@@ -406,4 +406,4 @@ def parseCmdLineArgs ():
 
 def parseBuildConfigFromCmdLineArgs ():
        args = parseCmdLineArgs()
-       return getBuildConfig(args.buildDir, args.targetName, args.buildType)
+       return getBuildConfig(args.buildDir, args.targetName, args.buildType)
\ No newline at end of file