descriptionnone
repository URLhttps://gitlab.freedesktop.org/mesa/piglit.git
ownerhramrach@centrum.cz
last changeWed, 20 Nov 2024 22:56:01 +0000 (20 22:56 +0000)
last refreshThu, 21 Nov 2024 08:19:43 +0000 (21 09:19 +0100)
content tags
add:
README.md

Piglit

  1. About
  2. Setup
  3. How to run tests
  4. Available test sets
  5. How to write tests
  6. Integration

1. About

Piglit is a collection of automated tests for OpenGL, Vulkan, and OpenCL implementations.

The goal of Piglit is to help improve the quality of open source OpenGL, Vulkan, and OpenCL drivers by providing developers with a simple means to perform regression tests.

The original tests have been taken from

2. Setup

First of all, you need to make sure that the following are installed:

Optionally, you can install the following:

For testing the python framework using py.test unittests/framework

Now configure the build system:

$ cmake . -G Ninja

Now build everything:

$ cmake --build .

2.1 Cross Compiling

On Linux, if cross-compiling a 32-bit build on a 64-bit host, first make sure you didn't have CMakeCache.txt file left from 64-bit build (it would retain old flags), then you must invoke cmake with options -DCMAKE_SYSTEM_PROCESSOR=x86 -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32.

2.2 Ubuntu

Install development packages.

$ sudo apt-get install cmake g++ mesa-common-dev libgl1-mesa-dev python3-numpy python3-mako freeglut3-dev x11proto-gl-dev libxrender-dev libwaffle-dev libudev-dev

Configure and build.

$ cmake . -G Ninja
$ cmake --build .

2.3 Mac OS X

Install CMake. http://cmake.org/cmake/resources/software.html Download and install 'Mac OSX Universal' platform.

Install Xcode. http://developer.apple.com/xcode

Configure and build.

$ cmake .
$ cmake --build .

2.4 Cygwin

Install development packages.

Configure and build.

$ cmake .
$ cmake --build .

2.5 Windows

Install Python 3. http://www.python.org/download

Install CMake. http://cmake.org/cmake/resources/software.html Download and install 'Windows' platform.

Download and install Ninja https://github.com/ninja-build/ninja/releases

Install MinGW-w64 https://mingw-w64.org/

Download OpenGL Core API and Extension Header Files. https://github.com/KhronosGroup/OpenGL-Registry Pass -DGLEXT_INCLUDE_DIR=/path/to/headers

Install python mako.

pip install mako

Install NumPy.

pip install numpy

2.5.1 GLUT

Download freeglut for Mingw. http://www.transmissionzero.co.uk/software/freeglut-devel/

cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext -DGLUT_INCLUDE_DIR=\path\to\freeglut\include -DGLUT_glut_LIBRARY=\path\to\freeglut\lib\x64\libfreeglut.a -DGLEXT_INCLUDE_DIR=\path\to\glext
ninja -C build

2.5.2 Waffle

Download and build waffle for MinGW. https://gitlab.freedesktop.org/mesa/waffle

Open the Command Prompt. CD to piglit directory.

cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext -DPIGLIT_USE_WAFFLE=TRUE -DWaffle_INCLUDE_DIRS=\path\to\waffle\include\waffle -DWaffle_LDFLAGS=\path\to\waffle\lib\libwaffle-1.dll.a

3. How to run tests

Make sure that everything is set up correctly:

$ ./piglit run sanity results/sanity

You may include '.py' on the profile, or you may exclude it (sanity vs sanity.py), both are equally valid.

You may also preface test profiles with tests/ (or any other path you like), which may be useful for shell tab completion.

You may provide multiple profiles to be run at the same time:

$ ./piglit run quick_cl gpu deqp_gles3 results/gl-cl-combined

Use

$ ./piglit run

or

$ ./piglit run -h

To learn more about the command's syntax.

Have a look into the tests/ directory to see what test profiles are available:

$ ls tests/*.py

See also section 4.

To create some nice formatted test summaries, run

$ ./piglit summary html summary/sanity results/sanity

Hint: You can combine multiple test results into a single summary. During development, you can use this to watch for regressions:

$ ./piglit summary html summary/compare results/baseline results/current

You can combine as many testruns as you want this way (in theory; the HTML layout becomes awkward when the number of testruns increases)

Have a look at the results with a browser:

$ xdg-open summary/sanity/index.html

The summary shows the 'status' of a test:

There are also dmesg-* statuses. These have the same meaning as above, but are triggered by dmesg related messages.

3.1 Environment Variables

There are a number of environment variables that control the way piglit behaves.

3.2 Note

The way piglit run and piglit summary count tests are different, piglit run counts the number of Test derived instance in the profile(s) selected, while piglit summary counts the number of subtests a result contains, or it's result if there are no subtests. This means that the number shown by piglit run will be less than or equal to the number calculated by piglit summary.

3.3 Shell Completions

Piglit has completions for bash, located in completions/bash/piglit. Once this file is sourced into bash piglit and ./piglit will have tab completion available. For global availability place the file somewhere that bash will source the file on startup. If piglit is installed and bash-completions are available, then this completion file will be installed system-wide.

4. Available test sets

Test sets are specified as Python scripts in the tests directory. The following test sets are currently available:

4.1 OpenGL Tests

4.2 OpenCL Tests

4.3 Vulkan tests

4.4 Replay tests

4.5 External Integration

5. How to write tests

Every test is run as a separate process. This minimizes the impact that severe bugs like memory corruption have on the testing process.

Therefore, tests can be implemented in an arbitrary standalone language. C is the preferred language for compiled tests, piglit also supports its own simple formats for test shaders and glsl parser input.

All new tests must be added to the appropriate profile, all.py profile for OpenGL and cl.py for OpenCL. There are a few basic test classes supported by the python framework:

5.1 Contributing

See the HACKING file.

6. Integration

Piglit provides integration for other test suites as well. The rational for this is that it provides piglit's one process per test protections (one test crashing does not crash the whole suite), and access to piglit's reporting tools.

Most integration is done through the use of piglit.conf, or through environment variables, with piglit.conf being the preferred method.

6.1 dEQP

Piglit provides a generic layer for dEQP based test suites, and specific integration for several suites.

Use the upstream dEQP repo (maintained by Khronos members), which contains the official conformance tests (CTS): https://github.com/KhronosGroup/VK-GL-CTS

Once dEQP is built add the following information to piglit.conf, which can either be located in the root of the piglit repo, or in $XDG_CONFIG_HOME (usually $HOME/.config).

[deqp-gles2]
bin=<deqp source dir>/modules/gles2/deqp-gles2

[deqp-gles3]
bin=<deqp source dir>/modules/gles3/deqp-gles3

[deqp-gles31]
bin=<deqp source dir>/modules/gles31/deqp-gles31

These platforms can be run using deqp_gles*.py as a suite in piglit. For example:

./piglit run deqp_gles31 my_results -c

It is also possible to mix integrated suites and piglit profiles together:

./piglit run deqp_gles31 quick cl my_results

dEQP profiles generally contain all of the tests from the previous profile, so gles31 covers gles3 and gles2.

6.2 Khronos CTS

Add the following to your piglit.conf file:

[cts]
bin=<cts source dir>/cts/glcts
shortlog
9 hours ago Timothy Arceriglsl-1.10: test mesa bug conflict between globalsmain
20 hours ago Qiang Yuext_image_dma_buf_import-export-tex: fix multi plane...
20 hours ago Qiang Yutests: add ext_image_dma_buf_import-tex-modifier
7 days ago Timothy Arceriglsl-1.10: test mesa bug with forward declaration
10 days ago Pavel OndračkaARB_clear_texture: fix GL_CLEAR_TEXTURE query check...
2024-11-07 Pavel Ondračkaglsl-1.30: move tests requiring uint from glsl-1.20
2024-11-06 David Heidelbergcl: print the failing value in r600 test
2024-10-24 Mike Blumenkrantzframework: call destroy directly instead of using atexit
2024-10-24 Timothy Arceriglsl-1.20: loop unroll tests for uint induction var
2024-10-22 Mike Blumenkrantzframework: move atexit call closer to init
2024-10-16 Timothy Arceriarb_bindless_texture: better test UBOs used as function...
2024-10-16 Tapani Pälliarb_compute_shader: add a compiler test for function...
2024-10-15 Michel Dänzercl: Don't use device_infos if num_device_infos == 0
2024-10-08 David Heidelbergcl: extend cl_device_info with OpenCL 3.0 parameters
2024-10-08 David Heidelbergcl: cl_mem_flags has CL_MEM_KERNEL_READ_AND_WRITE since 2.0
2024-10-07 David Heidelbergcl: Fix missing OpenCL 3.0 definition
...
tags
15 years ago piglit-v1
heads
9 hours ago main
6 years ago ppgtt
7 years ago dither
14 years ago glsl2
14 years ago shader_runner
14 years ago glean-master
forks
Cached version (3524s old)
piglit/hramrach.git hramrach@centrum.cz 14 years ago