[Piglit] [PATCH 3/4] igt: use piglit.conf instead of a symlink

Chad Versace chad.versace at intel.com
Tue Jul 1 16:53:59 PDT 2014


On Mon, Jun 30, 2014 at 04:53:21PM -0700, Dylan Baker wrote:
> Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
> ---
>  piglit.conf.example |  4 ++++
>  tests/igt.py        | 11 ++++-------
>  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/piglit.conf.example b/piglit.conf.example
> index 3c1fe63..68dbc20 100644
> --- a/piglit.conf.example
> +++ b/piglit.conf.example
> @@ -6,3 +6,7 @@
>  [xts]
>  ; Set bindir equal to the root of the xts directory
>  ;bindir=/home/user/src/xts
> +
> +[igt]
> +; Set bindir equal to the absolute root of the igt directory
> +;bindir=/home/user/src/igt

I agree with the patch's goals. I hate the symlink the garbage too. It's
bitten me too many times.

But I think the details are incorrect, and bindir is not the correct
name. As defined in this patch, the igt test binaries live in
"${igt:bindir}/tests", not in "${igt:bindir}". What you're naming
"bindir" is actually the parent of the bindir.

I have the same comments for patch 4.

Maybe rename it "rootdir"? "testroot"? Or just simply "path"? There's no
*best* name, but I sure "bindir" is a wrong name.

> diff --git a/tests/igt.py b/tests/igt.py
> index 54e0907..3cb293a 100644
> --- a/tests/igt.py
> +++ b/tests/igt.py
> @@ -33,8 +33,9 @@ import errno
>  from datetime import datetime
>  
>  from os import path
> +import framework.core
>  from framework.profile import TestProfile
> -from framework.exectest import Test, TEST_BIN_DIR
> +from framework.exectest import Test
>  
>  __all__ = ['profile']
>  
> @@ -67,12 +68,8 @@ def checkEnvironment():
>  if 'IGT_TEST_ROOT' in os.environ:
>      igtTestRoot = os.environ['IGT_TEST_ROOT']
>  else:
> -    # Chase the piglit/bin/igt symlink to find where the tests really live.
> -    if os.path.exists(path.join(TEST_BIN_DIR, 'igt')):
> -        igtTestRoot = path.join(path.realpath(path.join(TEST_BIN_DIR, 'igt')),
> -                                'tests')
> -    else:
> -        igtTestRoot = ''
> +    igtTestRoot = framework.core.PIGLIT_CONFIG.get('igt', 'bindir')
> +    assert os.path.exists(igtTestRoot)
>  
>  # check for the test lists
>  if not (os.path.exists(os.path.join(igtTestRoot, 'single-tests.txt'))
> -- 
> 2.0.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list