Commits (10019)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

((nil . ((indent-tabs-mode . t)
(tab-width . 8)
(show-trailing-whitespace . t)
(whitespace-style face indentation)
(whitespace-line-column . 79)))
(prog-mode .
((c-file-style . "linux")
(eval ignore-errors
(require 'whitespace)
(whitespace-mode 1))))
(cmake-mode .
((cmake-tab-width . 8)
(eval ignore-errors
(require 'whitespace)
(whitespace-mode 1))))
(python-mode .
((indent-tabs-mode . nil)
(tab-width . 4)
(whitespace-line-column . 80)))
root = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
max_line_length = 79
indent_style = tab
tab_width = 8
max_line_length = 78
indent_style = tab
tab_width = 8
max_line_length = 78
indent_style = tab
tab_width = 8
max_line_length = 78
*.mako -crlf
image: alpine
- apk --no-cache add py2-pip python-dev
- pip install sphinx
- pip install Flask-Sphinx-Themes
- cd docs
- ./build-html.sh
- mv _build/html/ ../public/
- public
- master
- docs/**
language: python
os: linux
# Use Ubuntu Xenial (16.04 LTS) environment.
dist: xenial
- ccache
- pip
- docker
- BUILD=pytest
- env: BUILD=cmake
- python: 2.7
env: TOX_ENV="py27-{generator,noaccel,accel-nix,streams}"
- python: 3.5
env: TOX_ENV="py35-{generator,noaccel,accel-nix,streams}"
- python: 3.6
env: TOX_ENV="py36-{generator,noaccel,accel-nix,streams}"
- python: 3.7
env: TOX_ENV="py37-{generator,noaccel,accel-nix,streams}"
- |
if [[ $BUILD == pytest ]]; then
pip install tox
wget https://github.com/grammarly/rocker/releases/download/1.3.1/rocker-1.3.1-linux_amd64.tar.gz
tar xvf rocker-1.3.1-linux_amd64.tar.gz
rm rocker-1.3.1-linux_amd64.tar.gz
- |
if [[ $BUILD != pytest ]]; then
mkdir -p -m777 ~/.ccache
- |
if [[ $BUILD == pytest ]]; then
tox -e $TOX_ENV
./rocker build -f docker/Rockerfile.piglit ${DOCKER_TAG:+--var TAG=}${DOCKER_TAG} ${DOCKER_IMAGE:+--var IMAGE=}${DOCKER_IMAGE} ${DOCKER_PARENT:+--var PARENT=}${DOCKER_PARENT} .
- |
if [[ $BUILD != pytest ]]; then
if [[ -n $DOCKER_IMAGE && -n $DOCKER_TAG && -n $DOCKER_USERNAME && $TRAVIS_BRANCH == master ]]; then
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
docker push "${DOCKER_IMAGE}":"${DOCKER_TAG}"
This diff is collapsed.
......@@ -71,8 +71,10 @@ tests/glslparsertest/glsl2/norsetto-*
* GNU General Public License for more details.
/* Full text of the GPL v2 is included in documentation/GPL-2 */
/* Full text of the GPL v2 is included in licenses/GPL-2 */
Copyright (C) 2006 Robert Beckebans <trebor_7@users.sourceforge.net>
......@@ -63,25 +63,78 @@ entirely new project. The most important reasons are:
\ Coding style
\ Ugly Things (or: Coding style)
Basic formatting:
As a rule of thumb, coding style should be preserved in test code taken from
other projects, as long as that code is self-contained.
* Indent with 8-column tabs
* Limit lines to 78 characters or less
* Function return type and name go on successive lines
* Opening function brace goes on line by itself
* Opening statement braces go on same line as the 'for' or 'else'
* Use /* C style comments */, not // C++ style
* Don't write 'if (condition) statement;' on one line - put the statement on
a separate line. Braces around a single statement are optional.
Apart from that, the following rules are cast in stone:
The following indent command will generally format your code for piglit's
1. Use tabulators for indentation
2. Use spaces for alignment
3. No whitespace at the end of a line
indent -br -i8 -npcs -ce input.c -o output.c
See http://electroly.com/mt/archives/000002.html for a well-written rationale.
Though, that doesn't give perfect results. It messes up the
PIGLIT_GL_TEST_CONFIG_BEGIN/END section. And array initializers sometimes
come out funny.
Use whatever tabulator size you want:
If you adhere to the rules above, the tab size does not matter. Tab size 4
is recommended because it keeps the line lengths reasonable, but in the end,
that's purely a matter of personal taste.
When in doubt see other recently added piglit tests for coding style.
Code conventions:
* Use "const" qualifiers whenever possible on array declarations, pointers
and global variables.
* Use "static const" for initialized arrays whenever possible.
* Preprocessor macros should be UPPER_CASE
* Enumeration tokens should be UPPER_CASE
* Most other identifiers are lower_case_with_underscores
* Library, executable, and source file names are '<base>_<api>.'
e.g. libpiglitutil_gles2
* Test names are '<lowercasegroupname>-<testname>.' e.g. glsl-novertexdata
* Use int, float, bool except when GL types (GLint, GLfloat) are really needed
* Always declare GL entrypoint pointer type with APIENTRY, or use piglit
dispatch typedef
Test conventions:
* The goal is to find bugs and demonstrate them as simply as possible, not
to measure performance or demonstrate features.
* Write tests that are easily read, understood and debugged. Long, complicated
functions are frowned upon.
* Don't try to test too much in a single test program. Most piglit programs
are less than 300 lines long.
* If a test doesn't render anything, it doesn't need to set the window size.
* Avoid changing an existing testing such that it might fail where it
previously passed. Break it into subtests and add a new subtest, or add
a new test which supersedes the old one.
* Things that should be seen are drawn in green (or blue as a second color)
while red is for things that shouldn't be seen.
* Calculate drawing coordinates from piglit_width/piglit_height as needed,
instead of hard coding.
* If a test can safely run at the same time as other tests, add it as a
concurrent test in 'all.tests' (or wherever you add it).
Utility code:
Piglit has a rich set of utility functions for basic drawing, setting
up shaders, probing pixels, error checking, etc. Try to use them before
rolling your own.
Python framework:
Piglit uses python's PEP8 standard for formatting of python code; using only
spaces with no tabs for indenting. See
http://www.python.org/dev/peps/pep-0008/ for more information.
......@@ -97,7 +150,7 @@ For this reason, developers of OpenGL drivers and related software, and even
testers are encouraged to follow the git repository on freedesktop.org at all
times. A web interface to this repository can be found here:
Nevertheless, for purposes of marking a specific point in time for packaging
in an environment where non-developers do tests on a wide range of hardware,
......@@ -109,3 +162,39 @@ RELEASE and create an appropriate tag in the git repository.
This tag is the official way of marking a release, so the tarballs provided
automatically by the cgit frontend are official release tarballs.
\ Contributing Patches
If you want to contribute patches, please subscribe to the piglit
mailing list (http://lists.freedesktop.org/mailman/listinfo/piglit)
and then send them to piglit@lists.freedesktop.org using "git
send-email". One of the core piglit developers should respond with
comments and suggested improvements. The piglit mailing list is also
a good place for general discussion about piglit development, such as
future plans for the project, and coordinating work between
Note that Piglit patches use the terms "Reviewed-by", "Tested-by", and
"Acked-by" in the same way as they are used for Linux kernel patches
(see https://www.kernel.org/doc/Documentation/SubmittingPatches). You
are also welcome to add a "Signed-off-by" line to your patch, but it
is not required.
For developers who are new to piglit: when submitting a patch, it is
helpful to add a note (after the "---" line in the patch file)
indicating that you are new to the project and don't have commit
access; that way once your patch has been revised to meet our
standards of correctness and coding style, we will know that we should
commit it for you. If we forget, please remind us! Once you have
successfully contributed a handful of patches, feel free to apply for
commit access usind the process described here:
Please be patient--most of us develop graphics drivers (such as Mesa)
as our primary job, so we have limited time to respond to your patches
on the piglit mailing list. If your patch hasn't received a reply in
a week, send a follow-up email to make sure we haven't missed it. If
you have questions that are better discussed in real time, many piglit
developers can also be found in the #dri-devel channel on Freenode
1. About
2. Setup
3. How to run tests
4. Available test sets
5. How to write tests
6. Todo
1. About
Piglit is a collection of automated tests for OpenGL implementations.
The goal of Piglit is to help improve the quality of open source
OpenGL drivers by providing developers with a simple means to
perform regression tests.
The original tests have been taken from
- Glean ( http://glean.sf.net/ ) and
- Mesa ( http://www.mesa3d.org/ )
2. Setup
First of all, you need to make sure that the following are installed:
- Python 2.4 or greater
- cmake (http://www.cmake.org)
- GL, glu and glut libraries and development packages (i.e. headers)
- X11 libraries and development packages (i.e. headers)
- libpng, libtiff and related development packages (i.e. headers)
Now configure the build system:
$ ccmake .
This will start cmake's configuration tool, just follow the onscreen
instructions. The default settings should be fine, but I recommend you:
- Press 'c' once (this will also check for dependencies) and then
- Set "CMAKE_BUILD_TYPE" to "Debug"
Now you can press 'c' again and then 'g' to generate the build system.
Now build everything:
$ make
3. How to run tests
Make sure that everything is set up correctly:
$ ./piglit-run.py tests/sanity.tests results/sanity.results
This will run some minimal tests. Use
$ ./piglit-run.py
to learn more about the command's syntax. Have a look into the tests/
directory to see what test profiles are available:
$ cd tests
$ ls *.tests
$ cd ..
See also section 4.
To create some nice formatted test summaries, run
$ ./piglit-summary-html.py summary/sanity results/sanity.results
Hint: You can combine multiple test results into a single summary.
During development, you can use this to watch for regressions:
$ ./piglit-summary-html.py summary/compare results/baseline.results results/current.results
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:
pass This test has completed successfully.
warn The test completed successfully, but something unexpected happened.
Look at the details for more information.
fail The test failed.
skip The test was skipped.
[Note: Once performance tests are implemented, 'fail' will mean that the test
rendered incorrectly or didn't complete, while 'warn' will indicate a
performance regression]
[Note: For performance tests, result and status will be different concepts.
While status is always restricted to one of the four values above,
the result can contain a performance number like frames per second]
4. Available test sets
Test sets are specified as Python scripts in the tests directory.
The following test sets are currently available:
This suite contains minimal sanity tests. These tests must
pass, otherwise the other tests will not generate reliable results.
This suite contains all tests.
Run all tests, but cut down significantly on their runtime
(and thus on the number of problems they can find).
In particular, this runs Glean with the --quick option, which
reduces the number of visuals and state combinations tested.
These test suites are adaptations of all.tests, with some tweaks
to account for hardware limitations in Radeon chips.
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.
I recommend C, C++ and Python, as these are the languages that are already
used in Piglit.
All new tests must be added to the all.tests profile. The test profiles
are simply Python scripts. There are currently two supported test types:
This test starts a new process and watches the process output (stdout and
stderr). Lines that start with "PIGLIT:" are collected and interpreted as
a Python dictionary that contains test result details.
This is a test that is only used to integrate Glean tests
Additional test types (e.g. for automatic image comparison) would have to
be added to core.py.
Rules of thumb:
Test process that exit with a nonzero returncode are considered to have
Output on stderr causes a warning.
6. Todo
Get automated tests into widespread use ;)
Automate and integrate tests and demos from Mesa
Add code that automatically tests whether the test has rendered correctly
Performance regression tests
Ideally, this should be done by summarizing / comparing a history of
test results
Note that while some small artificial micro-benchmark could be added to
Piglit, the Phoronix test suite is probably a better place for
realistic performance testing.
This diff is collapsed.
Piglit To-Do items
Write projects in TODO file.