[Piglit] [PATCH] wgl: initial check-in of wgl utility code and wgl sanity check program

Brian Paul brianp at vmware.com
Tue Jul 18 15:16:05 UTC 2017


On 07/18/2017 01:06 AM, Jose Fonseca wrote:
> On 11/07/17 17:06, Brian Paul wrote:
>> Like the glx tests/utility code, but for wgl.
>>
>> Note, one must set the PIGLIT_PLATFORM env var to "wgl" before running
>> Piglit.  It looks like there's some Waffle work to look at before this
>> can be made automatic.
>> ---
>>   CMakeLists.txt               |   7 ++
>>   framework/core.py            |   2 +-
>>   tests/CMakeLists.txt         |   1 +
>>   tests/all.py                 |   5 ++
>>   tests/util/CMakeLists.gl.txt |  25 ++++++
>>   tests/util/piglit-wgl-util.c | 190
>> +++++++++++++++++++++++++++++++++++++++++++
>>   tests/util/piglit-wgl-util.h |  41 ++++++++++
>>   tests/wgl/CMakeLists.gl.txt  |  27 ++++++
>>   tests/wgl/CMakeLists.txt     |   1 +
>>   tests/wgl/wgl-sanity.c       |  88 ++++++++++++++++++++
>>   10 files changed, 386 insertions(+), 1 deletion(-)
>>   create mode 100644 tests/util/piglit-wgl-util.c
>>   create mode 100644 tests/util/piglit-wgl-util.h
>>   create mode 100644 tests/wgl/CMakeLists.gl.txt
>>   create mode 100644 tests/wgl/CMakeLists.txt
>>   create mode 100644 tests/wgl/wgl-sanity.c
>>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index cc26fa8..d560bcc 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -179,6 +179,13 @@ ELSE()
>>       option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" OFF)
>>   ENDIF()
>> +IF(PIGLIT_HAS_WGL)
>> +    option(PIGLIT_BUILD_WGL_TESTS "Build tests that require WGL" ON)
>> +ELSE()
>> +    option(PIGLIT_BUILD_WGL_TESTS "Build tests that require WGL" OFF)
>> +ENDIF()
>> +
>> +
>>   # Choose to build tests that use dma_buf.
>>   #
>>   # Piglit's dma_buf utilities require xcb-dri2 to gain DRM
>> authentication.
>> diff --git a/framework/core.py b/framework/core.py
>> index c2de5d0..9abc128 100644
>> --- a/framework/core.py
>> +++ b/framework/core.py
>> @@ -44,7 +44,7 @@ __all__ = [
>>       'parse_listfile',
>>   ]
>> -PLATFORMS = ["glx", "x11_egl", "wayland", "gbm", "mixed_glx_egl"]
>> +PLATFORMS = ["glx", "x11_egl", "wayland", "gbm", "mixed_glx_egl", "wgl"]
>>   class PiglitConfig(configparser.SafeConfigParser):
>> diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
>> index 7aab33f..ae50d0a 100644
>> --- a/tests/CMakeLists.txt
>> +++ b/tests/CMakeLists.txt
>> @@ -17,6 +17,7 @@ add_subdirectory (texturing)
>>   add_subdirectory (spec)
>>   add_subdirectory (fast_color_clear)
>>   add_subdirectory (perf)
>> +add_subdirectory (wgl)
>>   if (NOT APPLE)
>>       # glean relies on AGL which is deprecated/broken on recent Mac OS X
>> diff --git a/tests/all.py b/tests/all.py
>> index 4959789..f98b703 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -835,6 +835,11 @@ with profile.test_list.group_manager(
>>       g(['glx-query-renderer-coverage'], 'coverage')
>>   with profile.test_list.group_manager(
>> +        PiglitGLTest, 'wgl',
>> +        require_platforms=['wgl']) as g:
>> +    g(['wgl-sanity'])
>> +
>> +with profile.test_list.group_manager(
>>           PiglitGLTest,
>>           grouptools.join('spec', '!opengl 1.1')) as g:
>>       g(['copyteximage', '1D'], run_concurrent=False)
>> diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
>> index a01fce3..e11213a 100644
>> --- a/tests/util/CMakeLists.gl.txt
>> +++ b/tests/util/CMakeLists.gl.txt
>> @@ -33,6 +33,31 @@ IF(PIGLIT_BUILD_GLX_TESTS)
>>       )
>>   ENDIF(PIGLIT_BUILD_GLX_TESTS)
>> +IF(PIGLIT_BUILD_WGL_TESTS)
>> +    # XXX: This is currently duplicated wherever tests
>> +    # include "piglit-wgl-util.h". Is it possible to refactor it?
>> +    include_directories(
>> +        ${GLPROTO_INCLUDE_DIRS}
>> +    )
>
> There are two possible solutions: -
>
> - add GLPROTO_INCLUDE_DIRS include dir globally, assuming it doesn't
> cause interference
>
> - use target_include_directories(piglitwglutil ${GLPROTO_INCLUDE_DIRS})
> instead of include_directories(), which in theory should make any
> dependent target that links against piglitwglutil automatically include
> this include.
>
> But is this really needed for WGL?  Aren't these X11 proto headers?

It looks like I can remove that part entirely.  I copied and pasted too 
much.  Patch coming...

-Brian



More information about the Piglit mailing list