15 Piglit is a collection of automated tests for OpenGL and OpenCL
18 The goal of Piglit is to help improve the quality of open source
19 OpenGL and OpenCL drivers by providing developers with a simple means to
20 perform regression tests.
22 The original tests have been taken from
23 - Glean ( http://glean.sf.net/ ) and
24 - Mesa ( http://www.mesa3d.org/ )
30 First of all, you need to make sure that the following are installed:
34 - numpy (http://www.numpy.org)
35 - six (https://pypi.python.org/pypi/six)
36 - cmake (http://www.cmake.org)
37 - GL, glu and glut libraries and development packages (i.e. headers)
38 - X11 libraries and development packages (i.e. headers)
39 - waffle (http://www.waffle-gl.org)
41 Optionally, you can install the following:
43 - nose. A python test framework, used for running the python framework
44 test suite. (https://nose.readthedocs.org/en/latest/)
45 - tox. A tool for testing python packages against multiple configurations of
46 python (https://tox.readthedocs.org/en/latest/index.html)
47 - lxml. An accelerated python xml library using libxml2 (http://lxml.de/)
48 - simplejson. A fast C based implementation of the python json library.
49 (https://simplejson.readthedocs.org/en/latest/)
50 - backports.lzma. A packport of python3's lzma module to python2,
51 this enables fast native xz (de)compression in piglit for results files
52 (https://github.com/peterjc/backports.lzma)
54 Now configure the build system:
58 This will start cmake's configuration tool, just follow the onscreen
59 instructions. The default settings should be fine, but I recommend you:
60 - Press 'c' once (this will also check for dependencies) and then
61 - Set "CMAKE_BUILD_TYPE" to "Debug"
62 Now you can press 'c' again and then 'g' to generate the build system.
71 On Linux, if cross-compiling a 32-bit build on a 64-bit host, then you must
72 invoke cmake with option "-DCMAKE_SYSTEM_PROCESSOR=i386".
78 Install development packages.
79 $ sudo apt-get install cmake g++ mesa-common-dev libgl1-mesa-dev python-numpy python-mako freeglut3-dev x11proto-gl-dev libxrender-dev
81 Install additional components for which Ubuntu packages do not yet exist:
82 - waffle (http://www.waffle-gl.org)
93 http://cmake.org/cmake/resources/software.html
94 Download and install 'Mac OSX Universal' platform.
97 http://developer.apple.com/xcode
105 glean will not build with MacOSX10.7.sdk. If you are trying to
106 build glean on Mac OS 10.7 (Lion), you will have to use MacOSX10.6.sdk.
108 Set 'CMAKE_OSX_SYSROOT' to '/Developer/SDKs/MacOSX10.6.sdk'. Configure.
116 Install development packages.
135 http://www.python.org/download
138 http://sourceforge.net/projects/numpy/files/NumPy
141 http://cmake.org/cmake/resources/software.html
142 Download and install 'Windows' platform.
144 Install Microsoft Visual Studio 2013 or later.
145 Install 'Visual C++' feature.
147 Download OpenGL Core API and Extension Header Files.
148 http://www.opengl.org/registry/#headers
149 Copy header files to MSVC.
150 C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL
153 http://www.pip-installer.org/en/latest/installing.html
156 > c:\Python27\Scripts\pip.exe install mako
162 Download freeglut for MSVC.
163 http://www.transmissionzero.co.uk/software/freeglut-devel
165 Open Visual Studio Command Prompt.
166 Start Menu->All Programs->Visual Studio 2013->Visual Studio Tools->VS2013 x86 Native Tools Command Prompt
167 CD to piglit directory.
170 > C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
173 - Use default native compilers
174 Set these variables in the Advanced view.
181 Build from the Visual Studio Command Prompt.
187 Download waffle for MSVC.
188 http://www.waffle-gl.org/
190 Open the Command Prompt.
191 CD to piglit directory.
194 > C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
196 - 'Visual Studio 12 2013', or
197 - 'Visual Studio 12 2013 Win64'
198 - Use default native compilers
199 Set these variables in the Advanced view.
200 Note that the values provided are for reference purposed and may differ on your system.
201 - PIGLIT_USE_WAFFLE, BOOL, TRUE
202 - WAFFLE_INCLUDE_DIRS, PATH, ${waffle_root}\include\waffle
203 - WAFFLE_LDFLAGS, FILEPATH, ${waffle_root}\lib\waffle-1.lib
204 - GLEXT_INCLUDE_DIR, PATH, C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL
209 Build from the Command Prompt.
215 Make sure that everything is set up correctly:
217 $ ./piglit run sanity results/sanity
219 You may include '.py' on the profile, or you may exclude it (sanity vs sanity.py),
220 both are equally valid.
222 You may also preface test profiles with tests/ (or any other path you like),
223 which may be useful for shell tab completion.
225 You may provide multiple profiles to be run at the same time:
227 $ ./piglit run quick_cl gpu deqp_gles3 results/gl-cl-combined
235 To learn more about the command's syntax.
237 Have a look into the tests/ directory to see what test profiles are available:
243 To create some nice formatted test summaries, run
245 $ ./piglit summary html summary/sanity results/sanity.results
247 Hint: You can combine multiple test results into a single summary.
248 During development, you can use this to watch for regressions:
250 $ ./piglit summary html summary/compare results/baseline.results results/current.results
252 You can combine as many testruns as you want this way (in theory;
253 the HTML layout becomes awkward when the number of testruns increases)
255 Have a look at the results with a browser:
257 $ xdg-open summary/sanity/index.html
259 The summary shows the 'status' of a test:
261 pass This test has completed successfully.
263 warn The test completed successfully, but something unexpected happened.
264 Look at the details for more information.
266 fail The test failed.
268 crash The test binary exited with a non-zero exit code
270 skip The test was skipped.
272 timeout The test ran longer than its allotted time and was forcibly killed.
275 There are also dmesg-* statuses. These have the same meaning as above, but are
276 triggered by dmesg related messages.
281 The way 'piglit run' and 'piglit summary' count tests are different, 'piglit
282 run' counts the number of Test derived instance in the profile(s) selected,
283 while 'piglit summary' counts the number of subtests a result contains, or it's
284 result if there are no subtests. This means that the number shown by 'piglit
285 run' will be less than or equal to the number calculated by 'piglit summary'.
288 4. Available test sets
289 ----------------------
291 Test sets are specified as Python scripts in the tests directory.
292 The following test sets are currently available:
299 This suite contains minimal OpenGL sanity tests. These tests must
300 pass, otherwise the other tests will not generate reliable results.
303 This suite contains all OpenGL tests.
306 Run all tests, but cut down significantly on their runtime
307 (and thus on the number of problems they can find).
308 In particular, this runs Glean with the --quick option, which
309 reduces the number of visuals and state combinations tested.
312 A further reduced set of tests from quick.py, this runs tests only
313 for hardware functionality and not tests for the software stack.
316 A reduced set of tests from gpu.py removing tests that are problematic
320 This profile runs tests that don't touch the gpu, in other words all of
321 the tests in quick.py that are not run by gpu.py
324 A subset of all.py which runs only glslparser tests
327 A subset of all.py which runs only shader tests
334 This suite contains all OpenCL tests.
337 This runs all of the tests from cl.py as well as tests from opencv
341 4.3 External Integration
342 ------------------------
345 Support for running the X Test Suite using piglit.
348 Support for running Intel-gpu-tools test suite using piglit.
351 Support for running deQP's gles2 profile with piglit.
354 Support for running deQP's gles3 profile with piglit.
357 Support for running deQP's gles3.1 profile with piglit.
360 5. How to write tests
361 ---------------------
363 Every test is run as a separate process. This minimizes the impact that
364 severe bugs like memory corruption have on the testing process.
366 Therefore, tests can be implemented in an arbitrary standalone language.
367 C is the prefered language for compiled tests, piglit also supports its own
368 simple formats for test shaders and glsl parser input.
370 All new tests must be added to the appropriate profile, all.py profile for
371 OpenGL and cl.py for OpenCL. There are a few basic test classes supported by the
375 This is a test that is only used to integrate Glean tests
378 A shared base class for all native piglit tests.
380 It starts each test as a subprocess, captures stdout and stderr, and waits
381 for the test to return.
383 It provides test timeouts by setting the instances 'timeout' attribute to an
384 integer > 0 which is the number of seconds the test should run.
386 It interprets output by reading stdout and looking for 'PIGLIT: ' in the
387 output, and then reading any trailing characters as well formed json
388 returning the test result.
390 This is a base class and should not be used directly, but provides an
391 explanation of the behavior of the following classes.
394 A test class for native piglit OpenGL tests.
396 In addition to the properties of PiglitBaseTest it provides a mechanism for
397 detecting test window resizes and rerunning tests as well as keyword
398 arguments for platform requirements.
401 A test class for native piglit OpenCL tests.
403 It currently provides no special features.
406 A class for testing a glsl parser.
408 It is generally unnecessary to call this class directly as it uses a helper
409 function to search directories for tests.
412 A class for testing using OpenGL shaders.
414 It is generally unnecessary to call this class directly as it uses a helper
415 function to search directories for tests.