[Piglit] [PATCH] tests/deqp: add configuration option to control caselist generation

Alejandro PiƱeiro apinheiro at igalia.com
Thu Jun 6 14:38:53 UTC 2019

Right now, each time any deqp-like profile ask for the case list, it
calls to generate the caselist. As by default it doesn't pass any
parameter, it creates all the possible caselist. And there are some
test sets (like khr_gles) that calls this method several time. On slow
machines this means a significant startup time.

This commit adds a envvar that allows to keep the current
behaviour. But if disabled, if the caselist already exists, compare
the creation times with the deqp binary. If the binary is older that
the caselist, it assumes that the caselist is recent enough, and skips
calling the caselist generation method.
 framework/test/deqp.py | 8 ++++++++
 piglit.conf.example    | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/framework/test/deqp.py b/framework/test/deqp.py
index 5db2a922f..aea335079 100644
--- a/framework/test/deqp.py
+++ b/framework/test/deqp.py
@@ -66,6 +66,9 @@ _EXTRA_ARGS = get_option('PIGLIT_DEQP_EXTRA_ARGS',
                          ('deqp', 'extra_args'),
+force_caselist_regen = get_option('PIGLIT_DEQP_FORCE_CASELIST_REGEN',
+                                  ('deqp', 'force_caselist_regen'),
+                                  default='True')
 def select_source(bin_, filename, mustpass, extra_args):
     """Return either the mustpass list or the generated list."""
@@ -116,6 +119,11 @@ def gen_caselist_txt(bin_, caselist, extra_args):
     basedir = os.path.dirname(bin_)
     caselist_path = os.path.join(basedir, caselist)
+    if (force_caselist_regen == 'False' and
+        os.path.exists(caselist_path) and
+        os.path.getmtime(caselist_path) > os.path.getmtime(bin_)):
+        return caselist_path
     # TODO: need to catch some exceptions here...
     with open(os.devnull, 'w') as d:
         env = os.environ.copy()
diff --git a/piglit.conf.example b/piglit.conf.example
index 1877187df..5bb1ddff9 100644
--- a/piglit.conf.example
+++ b/piglit.conf.example
@@ -37,6 +37,12 @@ testB
 ; Options that affect all deqp based suites
+; If we regenerate the caselist files everytime we ask them, or if we
+; reuse them if already present and more recent that the deqp
+; binary. The environment variable PIGLIT_DEQP_FORGE_CASELIST_REGEN
+; overrides de value set here.
+; force_caselist_regen=True
 ; Path to the deqp-egl executable
 ; Can be overwritten by PIGLIT_DEQP_EGL_BIN environment variable

More information about the Piglit mailing list