summaryrefslogtreecommitdiff
path: root/framework
AgeCommit message (Collapse)AuthorFilesLines
2016-03-03framework/programs/run.py: Fix putting results in nested directoriesDylan Baker1-1/+1
Replaces mkdir with makedirs. Trivial Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-03-03framework/programs/run.py: Add option for overwriting filesDylan Baker1-7/+17
Rather than removing the results_path unconditionally (if it exists), this requires the that -o/--overwrite switch is provided to overwrite. This is the same syntax that `summary html` uses, and provides users a little bit of protection so they don't overwrite something they meant to keep. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-03-03framework/programs/run.py: Clear directory before startingDylan Baker1-1/+9
Currently piglit will run if a directory already exists, or die in a fire if the results_directory is pointed at a file. Both are bad, in the fist case if there are already X+Y tests in the 'tests' directory, and the current run only writes X tests, then Y-X tests from the previous run will be included (which can overwrite tests depending on the order that they were written). This clears those out, solving the problem. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-02-18framework/programs/summary.py: Fail gracefully with bad argumentsDylan Baker1-2/+11
Currently if one passes a bad directory to `piglit summary aggregate` then piglit will fail with an internal exception. This patch fixes that, catching the exception, and printing a helpful message and closing gracefully. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-02-11python: function with six version 1.5.2Dylan Baker5-12/+45
CMake actually marks that we require six 1.4.0, however, I can't find any packages anywhere for 1.4.0, and the lowest version I've seen requested is 1.5.2. This fixes requirements for working with six 1.5.2, and sets tox to use 1.5.2 (and a suitable version of mock). Primarily there are a few things we're using that are not available: six.moves.getcwd, six.viewvalues, six.python_2_unicode_compatible. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Brian Paul <brianp@vmware.com>
2016-02-11oclconform: Encode regex with 'unicode_escape' instead for 'string_escape'Tom Stellard1-1/+1
This fixes a run-time error with python 3.4. Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
2016-02-10framework/test/{opencv,oclconform}: fix subprocess returning bytesDylan Baker2-3/+4
During the hybridization this little bit was missed, causing the to subprocess to return bytes, while the rest of the code expected unicode. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Tom Stellard <thomas.stellard@amd.com>
2016-02-08summary/html: fix python 3 encoding issues.Dylan Baker1-2/+0
In python 3 the current implementation provides bytes instead of unicode, but the write mode is set for unicode. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/test/glsl_parser_test.py: stop supporting bytesDylan Baker2-11/+25
This makes the GLSLParserTest class only support str (unicode in python 2), and not bytes (str in python 2). Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/core.py: make collect_system_info return unicodeDylan Baker1-2/+2
This changes collect_system_info to convert the raw output of each command to unicode before returning it. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/backends/json.py: use text_type instead for strDylan Baker1-1/+1
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08Framework/backends/junit.py: fix bytes/unicode handling on python3Dylan Baker1-4/+6
This changes the junit.py script to always convert bytes into unicode before writing, since we do declare that our xml is encoded in unicode. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/log.py: fix next() callDylan Baker1-1/+1
In python 2 < 2.6, generators define a next() method. In python 2.6+ (including 2.7) they should define a __next__ method and are called with the next() function. In python 2.6 and 2.7 both are supported, but in 3.x only the __next__ method is supported Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/test/base.py: fix compare to None in python 3Dylan Baker1-0/+5
Also fix unittest that relied on compare to None having python 2 behavior. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08dmesg.py: Fix str/bytes/unicode for python 2/3 compatibilityDylan Baker1-2/+3
Mostly this involves marking str (unicode) and bytes explicitly and not mixing the two. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/status.py: Add __hash__ method to NoChangeStatusDylan Baker1-0/+3
Apparently these aren't inherited in python 3, which makes sense. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08compression.py: use the proper read and write modes for python versionsDylan Baker1-98/+118
In python 2 the write mode should be 'w', and the read 'r', but in python 3 they need to be 'wt', and 'rt' respectively. Python 3 also has an lzma module built in, which vastly simplifies supporting xz. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08opengl.py: fix bytes returned from wflinfo.Dylan Baker1-1/+3
Convert to unicode, this requires reworking the tests to ensure that they provide bytes instances in the right places, or they trip up on the decode method call, which in python 3 is only available on str (unicode), and not on bytes. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework,unittests: use __future__ unicode_literalsDylan Baker34-58/+134
Use unicode_literals from __future__. This makes undecorated strings (those not using and b or u prefix) into unicode instead of bytes in python 2. This means that bytes strings need to have a b prefix now. This also fixes a couple of unittests that broke during the transition. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/test/base.py: Make timeout work in python 3.xDylan Baker1-30/+61
This wraps the subprocess32/not subprocess32 in a six.PY2 block, and for python 3.x just imports subprocess and sets _EXTRA_ARGS appropriately. For MS Windows the timeout is disabled. This could be fixed, but I don't have any interest in getting it working. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/programs/run.py: use PIGLIT_CONFIG.safe_getDylan Baker1-19/+12
This implements the same behavior, but with a fallback parameter. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/profile.py: replace dictionary-comprehension with dict()Dylan Baker1-2/+2
There wasn't ever a need to use a comprehension here, this is simpler and easier to read and maintain. It might even be faster. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08python: use six.{iter,view}{items,keys,values}Dylan Baker14-33/+44
This was initially generated via the following sed command: sed -i \ -e 's@in \(.*\)\.iter\(values,keys,items\)()@in six.iter\2(\1)@g' \ -e 's@in \(.*\..*\)\.iter\(values,keys,items\)()@in six.iter\2(\1)@g' Then cleaned up by hand, including changes for view*. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/results.py: use compatDylan Baker1-2/+3
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/compat.py: Add a small module with some extra compatDylan Baker1-0/+41
All of these changes are submitted to upstream six, and are ontrack for landing. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08python: use six unicode/bytes/str handlingDylan Baker8-32/+50
This is not feature complete for python 3.x in and of itself, but it gets started by using six functions rather than str and unicode. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework: use six.add_metaclassDylan Baker5-10/+13
This makes metaclasses work on both python 3 and python 2, which have a different syntax for setting the metaclass of a class. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework/test/base.py: fix class/__slots__ conflict in python3Dylan Baker1-2/+1
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08python: use six.moves.cStringIODylan Baker1-6/+4
This is the fast C based version on python 2, and is adapative on python3, importing the C based version if it's available and falling back if necessary. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework: use six.moves.zipDylan Baker2-2/+5
six.moves.zip is itertools.izip on python 2, and builtins.zip in python 3. Which are the same lazy function Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework: use six.moves.BaseHTTPServerDylan Baker1-1/+2
This is another shim for something that moved between python3 and python2. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08framework: use six.moves.configparserDylan Baker1-7/+8
This module is a compatibility shim for python 3.x and 2.x Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08python: use six.moves.rangeDylan Baker1-1/+3
This is xrange on python 2.x and range on 3.x Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-02-08python: use future print, division, and absolute_importDylan Baker23-20/+24
These are the three python3 like behaviors that piglit should rely on. The only other applicable future import is unicode_literals. Although my plan is to use unicode_literals, that will actually cause behavioral changes in some cases, where these cause minimal changes to the code. Piglit will not be targeting < 3.2, they are old, unsupported, and have fewer features than 2.7. Piglit now has division (using / as floating division, and // as integer division), print as a function (rather than a statement), and absolute import, which changes the way import works when there's a conflict between a local import and a system wide one. Absolute import makes more sense, and copies the behavior of python 3 Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-01-21framework/test/base.py: Add environment variable to overwrite timeoutsDylan Baker1-1/+8
This variable allows timeouts to be disabled, which can be useful for debugging tests. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-21framework/backends/junit.py; timeouts are errorsDylan Baker1-1/+1
Previously a timeout would be marked as pass, but that makes no sense. This marks it as an error. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-21framework/test/base.py: use subprocess32 for timeouts.Dylan Baker1-83/+61
Subprocess32 provides a backport of python 3.2's subprocess module, which has a timeout parameter for Popen.communicate. When the timeout runs out then an exception is raised, and when that exception is caught we can kill the process. This is fairly similar to the way the current timeout mechanism works, except that the current mechanism is not thread safe. Since one of the major features of piglit is that it offer's processes isolated concurrency of tests, it makes sense to make the effort to provide a timeout mechanism that supports concurrency. Unfortunately there isn't a good cross platform mechanism for this in python 2.x, even with subprocess 32 only *nix systems are supported, not windows. The big advantage of this is it allows consistent behavior between python 2.x and 3.x as we look toward the future and the possibility of using a hybrid approach to transition to python 3.x while maintaining 2.x support until it's not needed. This patch look pretty substantial. It's not as big as it looks, since it adds some fairly big tests. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-12framework: Get traceback into json results.Jose Fonseca1-1/+2
Exceptions were not reaching it. Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
2016-01-08unittests: move framework/tests to unittestsDylan Baker34-8486/+0
Currently the framework is pretty confusing. There's 'test' which is a package containing test classes, then there's 'tests' which contains unit tests for the framework. This is obviously not optimal. Beyond that the unittests get installed, and that isn't really necessary. As a bonus this removes the unit tests from coverage reports, which is a nice plus. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-08base_tests.py: make import from within tests dir relativeDylan Baker1-1/+1
This is more groundwork to move the unit tests out of the framework directory. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-08framework/test/opengl.py: Add environment variable to turn off fast skippingDylan Baker1-0/+25
Setting PIGLIT_NO_FAST_SKIP will disable the fast skipping mechanism altogether. It does this by shadowing FastSkipMixin at import time. This method is robust and cheap, but makes testing difficult. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-08framework/tests: Use relative import for utilsDylan Baker27-28/+28
This commit was generated with the following sed commands: sed -i -e 's@from framework.tests import utils@from . import utils@g' sed -i -e 's@import framework.tests.utils as utils@from . import utils@g' Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-08junit_backend_tests.py: make schema path robustDylan Baker1-1/+1
Use a path relative to the unit test. This is groundwork for moving the unit tests out of the framework folder. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Vinson Lee <vlee@freedesktop.org>
2016-01-07framework/test/glsl_parser_test.py: allow forcing the desktop versionDylan Baker2-1/+17
This adds a new environment variable, PIGLIT_FORCE_GLSLPARSER_DESKTOP, which forces glsl_parser_test.py to use "glslparsertest" for GLES tests (instead of "glslparsertest_gles2"). This could be used to force testing ES_<ver>_compatibility extensions even when OpenGL ES tests are being built. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-07framework/test/glsl_parser_test.py: Handle gl versions correctlyDylan Baker2-46/+156
This patch fixes the behavior of glsl_parser_test in cases other that OpenGL and OpenGL ES are available. This means that if OpenGL ES isn't available then OpenGL ES shaders will be passed to the regular version of glslparsertest, which can run them with an ARB_ES<ver>_compatibility extension. When a test is for desktop OpenGL, but only OpenGL ES is available, then the test will skip in the python layer. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> v3: - Rebase on top of now upstream fast-skipping patches - When using glslparsertest to run GLES tests add ARB_ES<ver>_compatibility to gl_required, to integrate with fast skipping. - Fix some tests. These tests are pretty fragile and probably just need to be reworked. - small refactors, make use of the _is_gles_version helper - Split skip conditions into a private method v4: - Fix bug where ARB_ES<ver>_compatibility skip requirement would be overwritten if the test had other extension requirements (and update tests to catch this bug) - Rename some constants to be more clear - Remove use of flag for skipping.
2016-01-07glsl_parser_test.py: Fix which versions are sent to glslparsertest_gles2Dylan Baker2-2/+18
There are two versions of glslparsertest, an undecorated one for desktop OpenGL, and a '_gles2' suffixed one for OpenGL ES. Piglit should pass 3.1 and 3.2 to the '_gles2' version like it does for GLES 2 and GLES 3.0 This also extends the test generator to cover these new cases (and a few it should have been covering before). It now covers 1.00, 3.00, 3.10, 3.20, 3.00 es, 3.10 es, and 3.20 es. v5: - fix the wording of a comment Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-01-07framework: record pid of test process in resultsDylan Baker5-15/+46
This information can be used on linux in conjunction with scripts to associate information in dmesg with information in piglit results. Adds the pid information to both the json and junit backends, and adds tests for both. This information is not published into any of the summary modes on purpose. It's usefulness is limited to the system on which the test was ran, and only while a log of dmesg exists. v2: - remove extra newline in junit stderr (Mark) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Mark Janes <mark.a.janes@intel.com>
2016-01-07framework/tests/results_tests.py: refactor to_json and from_dict testsDylan Baker1-28/+49
This slightly refactors these test classes, fixing time time tests, and making the to_json test not do a dict -> test result -> dict conversion, skipping the first dict stage. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Mark Janes <mark.a.janes@intel.com>
2016-01-04framework/test/opengl.py: Fix opengl fast-skipping wflinfo errorsDylan Baker2-12/+127
This extends the version handling methods of the WflInfo class to handle two kinds of errors. First, it handles getting a patch version in OpenGL and GLSL version strings. Second, it handles getting back WFLINFO_GL_ERROR, such as is returned on the nvidia blob driver because of the patch version. v2: - update tests to cover more tests (Jose) - update gl_extensions to not return set(['WFLINFO_GL_ERROR']). This wouldn't break anything, but it wasn't strictly correct. Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2015-12-21framework/exceptions.py: Drop PIGLIT_DEBUGDylan Baker2-43/+6
Previously a stack trace would be suppressed in all instances unless the PIGLIT_DEBUG environment variable was truthy. This was suboptimal for a number of reasons. This patch removes that functionality, now only a subset of piglit specific exceptions that are meant to be suppressed are. All other exceptions are directly raised, stopping the runner immediately. Other piglit specific exceptions have been extended to have custom error messages rather than relying on the handler to add them. v2: - remove unit tests that no longer apply Reviewed-by: Jose Fonseca <jfonseca@vmware.com> (v1) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>