Age | Commit message (Collapse) | Author | Files | Lines |
|
I went with `# coding=utf-8` as it was the most common format in the
existing code:
24 # coding=utf-8
21 ## coding=utf-8
19 # encoding=utf-8
9 ## encoding=utf-8
6 # -*- coding: utf-8 -*-
I added it as the first line after the shebang, if any.
Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
|
|
Convert the rest of the commands using six to make them both python 2
and python 3 safe. This also changes the default chbang to python
instead of python2, which should only be a change on Arch linux.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
|
|
In python 3.x input is unicode by default, but in python 2.x everything
is a byte string by default (which assumes ascii encoding), this
includes input. Currently when running with python 3.x it's possible to
use unicode for input, but python 2.x will choke when it tries to encode
the bytes into unicode using the ascii codec.
For example, this will work with python 3.x but no with python 2.x:
(The character is yuki, Japanese for snow, if memory serves)
./piglit run quick 雪 -c
This is actually pretty easy to fix, when running with python 2.x
decode each input element into unicode using utf-8 as soon as the input
is received. This fixes the above example to work.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Marek Olšák <marek.olsak@amd.com>
|
|
This replaces #!/usr/bin/env python with #!/usr/bin/env python2, which
fixes the build on archlinux. This has been proposed before, but at that
time debian didn't provide a python2 executable, so it would break
debian. Debian sid as of today provides python2.
v2: - fix piglit as well
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
The new argument parsing wants the script name parameter
sys.argv[0] stripped off.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78421
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
|
|
This moves piglit-run and piglit-resume main() functions to
framework.programs.run as run() and resume() respectively, and moves
piglit-summary-* to framework.programs.summary. It then creates
compatibility wrappers as piglit-*.py for the functions.
This is groundwork for a combined piglit interface. The original files
could not be imported directly since they have dash (-) in their name,
and python considers dash an illegal character for function, class, and
modules names, and python would raise an ImportError when attempting to
import one of them.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
This is needed specifically by XTS, but it might be useful for other
external suites that want to move files out of their runtime directories
into the saved directory. Specifically if those files are linked into
the summary.
v3: - Add the results_dir name definition to the constructor
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
|
|
This solves a dependency loop between core and exectest, laying the
groundwork for future improvements to the exectest module.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
The extra newline is no longer necessary as the final summary line
includes one.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
One of the biggest changes between python2 and python3 is that print
changed from a statement to a function. This change was backported to
python2 in the __future__ module, and this patch makes that conversation
to ease the transition from python2 to python3.
v2: - Replace dict comprehension with dict(generator). This is for
python 2.6 compatability
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
|
|
This adds a verbose logger option, similar to that of the old piglit
logger, but with some of the flair of the new one.
v2: - Use different method to set Log.__string
- fix typo env.concurrent to correct env.verbose
- resume uses stored verbosity settings
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
This regression has been introduced in
commit 90a25641164c8a0c8cc09a5515864b654df9d368
Author: Dylan Baker <baker.dylan.c@gmail.com>
Date: Mon Jan 27 11:23:28 2014 -0800
Use the new dmesg class
The original logic to always capture dmesg for igt tests has been
added in
commit da3819f07ca2b74b386ee96b8af1e141c36ec8ce
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Mon Nov 11 22:04:32 2013 +0100
igt: Enable dmesg checking by default
Cc: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Dmesg reporting has always been inaccurate with concurrent runs, and the
solution to concurrent runs would be to have each run take out a lock,
removing the chance that another test generated an error in dmesg while
it was running. But this effectively makes them a serial run, and at the
cost of greater code complexity. With that in mind it makes more sense
to just force --dmesg to imply -1.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
This actually makes use of the new dmesg class rather than the dmesg
functions. It touches a lot of files, but almost all of these changes
are code removal rather than code addition.
v5: - Fix dmesg handling in resume
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (v4)
|
|
v2: - remove duplicate core imports
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
The config parser will read options from a file called piglit.conf
in the root of piglit's source directory or from a file specified
by the -f option to piglit-run.py
Tom Stellard:
- Added command-line option
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This patch gives piglit run the ability to take one or more test
proflies as arguments rather than just one. It loads the profiles,
merging them from left to right, overwriting conflicting results. This
will allow the oglconform and es3conform loaders to be taken out of
all.tests.
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This patch adds support in piglit-run to save the -p platform
information if it was provided, and adds support in piglit-resume to
restore this information if it is stored.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This patch adds a new concurrency option that runs all tests out of a
multi-threaded pool, ignoring their request to be threaded or not. This
new option is mutually exclusive with the -1/--no-concurrency option.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
The resume functionality actually shares only a little boilerplate with
the run functionality, and there is a lot of extra boilerplate that
exists (or should exist) to make resumes work correctly with all of the
command line options allowed by piglit-run. Therefore, it makes more
sense to split it out into it's own file.
Reviewed by: Kenney Phillis <Kkphillisjr@gmail.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This causes all attributes in the Environment instance env to be dumped
into the json and reloaded on a resume. It adds an __iter__ magic method
to core.Environment to allow this.
Reviewed by: Kenney Phillis <Kkphillisjr@gmail.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This patch tidies up a few things, and lays groundwork for later patches
in this series.
Reviewed by: Kenney Phillis <Kkphillisjr@gmail.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This breaks incomplete runs started before applying the previous patch
in this series, since there will be no key for concurrency
v2: - Add this patch (Damien Lespiau)
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed by: Kenney Phillis <kphillisjr@gmail.com>`
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
cc: ben@bwidawsk.net
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed by: Kenney Phillis <kphillisjr@gmail.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
simplejson is a native code version of the json module in python
(the json module in core python implements the simplejson api), which
means that simplejson can be used in place of the json module, but it
performs much better. This patch attempts to load simplejson, and falls
back to normal json if it fails.
In the summary path on a single run of quick.tests, simplejson is about
3-4 seconds faster than json, ~7 seconds vs ~11 seconds.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This is in keeping with PEP8 sytle guidelines for function names:
"Function names should be lowercase, with words separated by underscores
as necessary to improve readability."
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This is purely formatting changes with no functional changes.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
The Radeon driver writes GPU page faults to dmesg and we need to know which
tests caused them.
If there is any change in dmesg during a test run, the test result is changed
as follows:
* pass -> dmesg-warn
* warn -> dmesg-warn
* fail -> dmesg-fail
Dmesg is captured before and after each test and the difference between the two
is stored in the test summary.
The piglit-run.py parameter which enables this behavior is --dmesg. It's also
recommended to use -c0.
v2: - address some of Dylan's remarks, mainly bug fixes
- fix get_dmesg_diff
Reviewed-by: Dylan Baken <baker.dylan.c@gmail.com>
|
|
The current behavior is to write a key, and then dump the status into
it. This reimplements what JSONWireter.write_dict_item() already does,
so just use the write_dict_item() method.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
Remove deprecated options that were carried over from the getopt =>
argparse conversion. These options were kept as for compatibility, but
marked as deprecated; and their continued existence clutters the code.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Path resolution should always be a resolved from relative path to absolute path.
This is to allow for distributed testing where you build a single copy of
piglit and then redistribute it over a network.
Signed-off-by: Kenney Phillis <kphillisjr@gmail.com>
v2: Correct whitespace errors
Convert tabs to spaces
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
PEP 8 specifies that all indents should be either 4 spaces or an
equivalent tab indent, but without mixing tabs and spaces, with a
preference for spaces over tabs because they are absolute. Tabs and
spaces should not be mixed because they lead to expected indent level
errors.
Currently piglit uses a mixture of spaces and tabs, this patch uses the
python tools reindent.py to convert the tabs to spaces.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
v2: Rebase against master, fix apparent unintentional unindentation of
help text in piglit-summary.py (changes by anholt)
Reviewed-by: Eric Anholt <eric@anholt.net>
|
|
Move the re.compile into the core.Enivironment constructor, which
reduces code duplication. It also allows us to pass environment data on
initilization of the object, rather that having edit it's attributes
individually.
V2: - Does not remove deprecated options, only marks them as such
V3: - Fixes deperecated warning for tests from V2 always being triggered
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
This change gets us cleaner, more readable argument parsing code.
Another advantage of this approach is that it automatically generates
help menus, which means options will not be implemented without a help
entry (like --resume)
V2: - Does not remove deprecated options, only marks them as deprecated
V3: - Fixes deprecated warning for tests from V2 always being triggered
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
This option was implemented, however, it was not added to the help menu,
meaning that a user needed to know that it existed before they could
even attempt to use it.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
Since piglit defaults to using concurrency, and since concurrency is
generally the desired behavior, it seems more appropriate to have a flag
that turns off concurrency than one that takes an argument to set it on
or off.
V2: - Leaves --concurrency option, but marks it as deprecated
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
Excluding tests already uses a similar syntax (--exclude-tests), so this
is more consistent.
V2: - Leaves --tests option, but marks it as deprecated
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
Fix resolution of relative paths to absolute paths. This will help keep
piglit from crashing out when resume path is not within source path. This
happens regularly when using distributed testing.
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
|
|
At this point, Glean wasn't writing anything interesting anyway;
it was just clutter.
Since there's no need to specify a results directory on the command line
any longer, this patch also removes the -r option, making "run tests"
the default action.
This also allows us to simplify the Piglit runner framework a little:
it no longer has to pass around the results directory just to pass to
Glean.
|
|
This can be useful with gbm when running piglit-run.py under sudo.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
|
|
platform where the os seperator is not '\'.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
|
|
Valgrind testing is useful, but really should be done as a separate
exercise from the usual regression testing, as it takes way too long.
Rather than including it by default in all.tests and making people
exclude it with the -x valgrind option (or by using quick.tests), it
makes sense to explicitly request valgrind testing with --valgrind.
To perform valgrind testing:
$ piglit-run.py --valgrind <options> tests/quick.tests results/vg-1
The ExecTest class now handles Valgrind wrapping natively, rather than
relying on the tests/valgrind-test/valgrind-test shell script wrapper.
This provides a huge benefit: we can leverage the interpretResult()
function to make it work properly for any subclass of ExecTest. The
old shell script only worked for PlainExecTest (piglit) and GleanTest.
Another small benefit is that you can now use --valgrind with any test
profile (such as quick.tests). Also, you can use all.tests without
having to remember to specify "-x valgrind".
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
GPUs like to hang, especially when barraged with lots of mean Piglit
tests. Usually this results in the poor developer having to figure out
what test hung, blacklist it via -x, and start the whole test run over.
This can waste a huge amount of time, especially when many tests hang.
This patch adds the ability to resume a Piglit run where you left off.
The workflow is:
$ piglit-run.py -t foo tests/quick.tests results/foobar-1
<interrupt the test run somehow>
$ piglit-run.py -r -x bad-test results/foobar-1
To accomplish this, piglit-run.py now stores the test profile
(quick.tests) and -t/-x options in the JSON results file so it can tell
what you were originally running. When run with the --resume option, it
re-reads the results file to obtain this information (repairing broken
JSON if necessary), rewrites the existing results, and runs any
remaining tests.
WARNING:
Results files produced after this commit are incompatible with older
piglit-summary-html.py (due to the extra "option" section.)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
|
|
When resuming an interrupted piglit run, we'll want to output both
existing and new results into the same 'tests' section. Since
TestProfile.run only handles newly run tests, it can't open/close the
JSON dictionary.
So, move it to the caller in piglit-run.py.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
|
|
list[:0] = [item] is a strange way to add an item to a list.
1. It forces the list to be copied, which can be inefficient.
2. It produces a strange ordering:
>>> x = [1, 2, 3]
>>> x[:0] = [4]
>>> x
[4, 1, 2, 3]
...whereas list.append(item) produces [1, 2, 3, 4].
3. Most importantly, list.append is easier to understand at a glance.
Reported-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
piglit-run.py takes the directory to store the results in as a command
line argument, yet always chdir's to piglit_dir first before accessing it.
When running piglit from outside of piglit_dir, this is surprising to the
user and will fail when piglit is packaged in a distribution and the user
can't write to piglit_dir.
This came up while packaging piglit for Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=773021
where all piglit code is placed under /usr/lib64/piglit/ and symbolic
links to the piglit-* scripts are created in /usr/bin/.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Scott Tsai <scottt.tw@gmail.com>
|
|
The main purpose of this patch is to make piglit independent of the
current working directory, so it is possible to package piglit as a RPM
package (with binaries symlinked to /usr/bin, most of the files in
read-only /usr/lib*/piglit directory, and results somewhere else).
So it is now possible to run
$ piglit-run tests/quick-driver.tests /tmp/piglit
and then with this command
$ piglit-summary-html --overwrite /tmp/piglit/results /tmp/piglit/main
generate a report in /tmp/piglit/results/index.html & al.
Signed-off-by: Matěj Cepl <mcepl@redhat.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
|