summaryrefslogtreecommitdiff
path: root/piglit-run.py
AgeCommit message (Collapse)AuthorFilesLines
2018-11-08python: add explicit utf-8 encodingEric Engestrom1-0/+1
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>
2016-05-02framework: update the rest of the piglit-* commands to be py3Dylan Baker1-3/+8
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>
2016-04-16piglit: Fix spelling mistakesEric Engestrom1-1/+1
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>
2016-03-28framework: fix unicode command line arguments with python 2.xDylan Baker1-1/+5
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>
2014-06-19python: change she-bang to python2Dylan Baker1-1/+1
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>
2014-05-08wrappers: Fix argument issue with new wrapper scriptsJordan Justen1-1/+1
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>
2014-05-06framework: move executable functions to modulesDylan Baker1-177/+22
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>
2014-04-24python: Add results_dir to TestProfileDylan Baker1-0/+1
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)
2014-04-17framework: Split TestProfile and related out of coreDylan Baker1-1/+2
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>
2014-04-02Remove extra newline from the end of run messageThomas Wood1-2/+1
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>
2014-03-12python: Convert from print statement to functionDylan Baker1-3/+4
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)
2014-02-20log: add verbose loggerDylan Baker1-1/+6
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>
2014-02-06tests/igt: restore dmesg-by-defaultDaniel Vetter1-1/+2
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>
2014-02-04piglit-run.py: Restrict dmesg to serial runsDylan Baker1-1/+6
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>
2014-02-04Use the new dmesg classDylan Baker1-0/+2
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)
2014-01-28piglit-run.py: Remove unused importsDylan Baker1-5/+3
v2: - remove duplicate core imports Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-01-23framework/core.py: Add a config parserDylan Baker1-0/+13
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>
2014-01-12Add support to load multiple test profilesDylan Baker1-2/+3
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>
2014-01-09Save and restore platform for piglitDylan Baker1-0/+3
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>
2013-12-19Add new concurrency optionDylan Baker1-4/+13
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>
2013-11-19Split resume functionality out of piglit-run.pyDylan Baker1-37/+4
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>
2013-11-19piglit-run.py: Record all attributes of Environment and restore themDylan Baker1-3/+2
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>
2013-11-19piglit-run.py: CleanupsDylan Baker1-15/+11
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>
2013-11-19piglit-run.py: resume honors saved concurrency flagDylan Baker1-0/+1
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>
2013-11-19piglit-run.py: record whether the test run was concurrentDylan Baker1-0/+1
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>
2013-10-23Use simplejson if availableDylan Baker1-1/+0
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>
2013-10-20rename core.loadTestResults to core.load_resultsDylan Baker1-1/+1
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>
2013-10-11piglit-run.py: Fix a few PEP8 issues that snuck inDylan Baker1-12/+15
This is purely formatting changes with no functional changes. Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
2013-09-23piglit-run: add -1 as an alternative to --no-concurrentMarek Olšák1-1/+1
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
2013-09-23Optionally capture dmesg changes for each test and report them in a summaryMarek Olšák1-1/+5
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>
2013-09-17piglit-run.py: replace file.write with json_writer callsDylan Baker1-4/+2
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>
2013-08-28piglit-run.py: Remove deprecated optionsDylan Baker1-53/+12
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>
2013-07-29piglit-run.py: PEP8 ComplianceDylan Baker1-53/+47
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-16piglit-run.py: Fix Path resolution.Kenney Phillis1-3/+3
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>
2013-05-13python: Convert tabs to spacesDylan Baker1-184/+184
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>
2013-03-10Move re.compile for regex into CoreDylan Baker1-35/+25
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>
2013-03-10Replaces getopt with argparseDylan Baker1-126/+123
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>
2013-03-10piglit-run.py: Add --resume to the help menuDylan Baker1-0/+2
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>
2013-03-10piglit-run.py: Replace Piglit's --concurent flag with --no-concurrencyDylan Baker1-3/+13
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>
2013-03-10Change --tests to --include-testsDylan Baker1-2/+10
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>
2013-02-08piglit-run: Fix resume path resolvingKenney Phillis1-1/+1
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>
2013-01-03glean: Remove support for writing results databases.Kenneth Graunke1-1/+1
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.
2012-10-19piglit-run.py: add -p|--platform switch to select the piglit platformJordan Justen1-1/+9
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>
2012-07-16Changed piglit-run.py to automatically correct previous test results on a ↵Kenney Phillis1-0/+2
platform where the os seperator is not '\'. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-03-12Make valgrind testing a command line option rather than extra tests.Kenneth Graunke1-0/+4
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>
2012-03-02Add the ability to resume an interrupted test run where it left off.Kenneth Graunke1-5/+54
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>
2012-03-02Move writing of JSON 'tests' dictionary section out of TestProfile.run.Kenneth Graunke1-2/+7
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>
2012-02-24piglit-run.py: Use list.append(item) instead of list[:0] = [item].Kenneth Graunke1-2/+2
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>
2012-01-17piglit-run: support storing results outside of piglit_dirScott Tsai1-1/+1
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>
2011-10-13Make Python scripts independent of the current working directoryMatěj Cepl1-1/+6
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>