<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 18, 2017 at 6:28 PM, Dylan Baker <span dir="ltr"><<a href="mailto:dylan@pnwbakers.com" target="_blank">dylan@pnwbakers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Quoting Brian Paul (2017-10-12 21:23:05)<br>
<div><div class="h5">> 1. If the PIGLIT_PLATFORM string is 'mixed_glx_egl' we need to convert<br>
> it to 'glx' so that wflinfo understands it.<br>
><br>
> 2. Look in the piglit bin/ directory for the wflinfo.exe program.<br>
> When we build piglit, we copy wflinfo.exe into the bin/ directory for<br>
> packaging to avoid having to install waffle on target machines.  If<br>
> it's not found there, assume it's in our PATH just like before.<br>
> ---<br>
>  framework/test/opengl.py | 25 ++++++++++++++++++++++---<br>
>  1 file changed, 22 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/framework/test/opengl.py b/framework/test/opengl.py<br>
> index 091aeb0..20e1c4f 100644<br>
> --- a/framework/test/opengl.py<br>
> +++ b/framework/test/opengl.py<br>
> @@ -33,6 +33,7 @@ import six<br>
>  from framework import exceptions, core<br>
>  from framework.options import OPTIONS<br>
>  from .base import TestIsSkip<br>
> +from framework.test import piglit_test<br>
><br>
>  # pylint: disable=too-few-public-methods<br>
><br>
> @@ -53,6 +54,17 @@ class StopWflinfo(exceptions.<wbr>PiglitException):<br>
>          self.reason = reason<br>
><br>
><br>
> +def find_wflinfo():<br>
> +    """Find location of the wflinfo executable."""<br>
> +    # First check if it's in our piglit bin/ directory<br>
> +    wflinfo = os.path.join(piglit_test.TEST_<wbr>BIN_DIR, "wflinfo.exe")<br>
> +    if os.path.exists(wflinfo):<br>
> +        return wflinfo<br>
> +    else:<br>
> +        # Assume it's in $PATH<br>
> +        return "wflinfo"<br>
> +<br>
> +<br>
>  class WflInfo(object):<br>
>      """Class representing platform information as provided by wflinfo.<br>
><br>
> @@ -92,16 +104,23 @@ class WflInfo(object):<br>
>          """<br>
>          with open(os.devnull, 'w') as d:<br>
>              try:<br>
> +                # Get the piglit platform string and, if needed, convert it<br>
> +                # to something that wflinfo understands.<br>
> +                platform = OPTIONS.env['PIGLIT_PLATFORM']<br>
> +                if platform == "mixed_glx_egl":<br>
> +                    platform = "glx"<br>
> +<br>
> +                wflinfo = find_wflinfo()<br>
> +<br>
<br>
</div></div>instead of find_wflinfo, what about adding<br>
"env={'PATH': '{}:{}'.format(piglit_test.<wbr>TEST_BIN_DIR, os.environ['PATH'])" to<br>
the check_output call, and adding an if to change wflinfo to wflinfo.exe on<br>
windows?<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>AFAICT, the check_output() doesn't take an env argument.  Maybe I'm misunderstanding.  Can you propose concrete code?</div><div><br></div><div>-Brian<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
>                  raw = subprocess.check_output(<br>
> -                    ['wflinfo',<br>
> -                     '--platform', OPTIONS.env['PIGLIT_PLATFORM']<wbr>] + opts,<br>
> -                    stderr=d)<br>
> +                    [wflinfo, '--platform', platform] + opts, stderr=d)<br>
>              except subprocess.CalledProcessError:<br>
>                  # When we hit this error it usually going to be because we have<br>
>                  # an incompatible platform/profile combination<br>
>                  raise StopWflinfo('Called')<br>
>              except OSError as e:<br>
>                  # If we get a 'no wflinfo' warning then just return<br>
> +                print("wflinfo utility not found.")<br>
>                  if e.errno == errno.ENOENT:<br>
>                      raise StopWflinfo('OSError')<br>
>                  raise<br>
> --<br>
> 1.9.1<br>
><br>
> ______________________________<wbr>_________________<br>
> Piglit mailing list<br>
> <a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
</div></div><br>______________________________<wbr>_________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
<br></blockquote></div><br></div></div>