Add --deqp-archive-dir command line option
authorThomas Spurden <thomas.spurden@broadcom.com>
Mon, 7 Oct 2019 13:59:01 +0000 (14:59 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 21 Nov 2019 09:36:56 +0000 (04:36 -0500)
Allows running in a different working directory from the archive
directory.

Components: Framework
VK-GL-CTS Issue: 2105

Change-Id: I803d735e7ca304069c881db90c195474f62c98f5

external/openglcts/README.md
external/vulkancts/README.md
framework/common/tcuCommandLine.cpp
framework/common/tcuCommandLine.hpp
framework/platform/tcuMain.cpp

index b5fb689..b71b926 100644 (file)
@@ -642,6 +642,10 @@ Full list of parameters for the `glcts` binary:
     Run tests that exhaust memory on purpose
     default: 'disable'
 
+  --deqp-archive-dir=<value>
+    Path to test resource files
+    default: current working directory
+
   --deqp-case-fraction=<value>,<value>
     Run a fraction of the test cases (e.g. N,M means run group%M==N)
     default: ''
index c86c9e8..66f1021 100644 (file)
@@ -140,6 +140,11 @@ platform requires a different path, it can be specified with:
 
        --deqp-log-filename=<path>
 
+By default, the CTS will expect to find its test resource files in the current
+working directory. This can be overridden with:
+
+       --deqp-archive-dir=<path>
+
 By default, the shader cache will be written into the path "shadercache.bin". If the
 platform requires a different path, it can be specified with:
 
index bdb76ff..de9c337 100644 (file)
@@ -86,6 +86,7 @@ DE_DECLARE_COMMAND_LINE_OPT(EGLPixmapType,                            std::string);
 DE_DECLARE_COMMAND_LINE_OPT(LogImages,                                 bool);
 DE_DECLARE_COMMAND_LINE_OPT(LogShaderSources,                  bool);
 DE_DECLARE_COMMAND_LINE_OPT(TestOOM,                                   bool);
+DE_DECLARE_COMMAND_LINE_OPT(ArchiveDir,                                        std::string);
 DE_DECLARE_COMMAND_LINE_OPT(VKDeviceID,                                        int);
 DE_DECLARE_COMMAND_LINE_OPT(VKDeviceGroupID,                   int);
 DE_DECLARE_COMMAND_LINE_OPT(LogFlush,                                  bool);
@@ -185,6 +186,7 @@ void registerOptions (de::cmdline::Parser& parser)
                << 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<ArchiveDir>                                   (DE_NULL,       "deqp-archive-dir",                                                     "Path to test resource files",                                                                                  ".")
                << 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")
@@ -824,6 +826,7 @@ bool                                        CommandLine::isSpirvOptimizationEnabled         (void) const    { return m_cmdLin
 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::getArchiveDir                                      (void) const    { return m_cmdLine.getOption<opt::ArchiveDir>().c_str();                                        }
 
 const char* CommandLine::getGLContextType (void) const
 {
index a7cb3ab..88527f2 100644 (file)
@@ -240,6 +240,9 @@ public:
        //! Get must-list filename
        const char*                                             getCaseFractionMandatoryTests(void) const;
 
+       //! Get archive directory path
+       const char*                                             getArchiveDir                           (void) const;
+
        /*--------------------------------------------------------------------*//*!
         * \brief Creates case list filter
         * \param archive Resources
index f3e0fb4..57d62e8 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc, char** argv)
        try
        {
                tcu::CommandLine                                cmdLine         (argc, argv);
-               tcu::DirArchive                                 archive         (".");
+               tcu::DirArchive                                 archive         (cmdLine.getArchiveDir());
                tcu::TestLog                                    log                     (cmdLine.getLogFileName(), argc-1, argv+1, cmdLine.getLogFlags());
                de::UniquePtr<tcu::Platform>    platform        (createPlatform());
                de::UniquePtr<tcu::App>                 app                     (new tcu::App(*platform, archive, log, cmdLine));