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>
|
|
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>
|
|
This optimizes the common paths of OGLCTest.interpret_result(): pass and
the common skip case.
For most OGLCTest cases the result will be in the final 3 lines of
stdout. In this case it is substantially faster to split the last 3
lines, and then check for a string in that list than to use either an
RegexObject (even a pre-compiled one) or to use a 'str in str'
approach.
I've used a script to benchmark the performance of each approach, using
the actual output of a test. This assumes a single expression in the
RegexObject (no use of 'or'). This script is in the mailing list archive
for those curious, but I felt it was too long to leave in a commit
message.
The final approach is 10x faster than the 'str in str' approach, and
6.5x faster than the compiled re. While interpret_result doesn't
constitute a huge amount of time in the piglit run, it does account for
some of it, and this should at least shave a few seconds off the final
run time.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Currently Test is imported from framework.profile and this happens to
work. However, this isn't the correct place to get Test from, and it
isn't guaranteed to continue working in the future.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
I'm a little surprised this actually works in current form, since it's
currently pointing to an int, rather than a file-like object.
This patch simplifies the code by pointing at the open file-like object.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Fixes the following warnings from pylint:
- constants should be ALL_CAPS
- shadowing names from the outer scope
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
|
|
This moves code out of the try/except block that we don't mean to catch
exceptions in, which is better coding practice.
This also sets the except block to ValueError only, which is the error
that will occur if there aren't enough values to unpack, which the
except block was added to catch.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This moves some constant arguments out of the permanently stored values
in each test instance into a getter, which reduces the number of
duplicate elements that need to be stored per instance. This reduces
memory usage a little.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This is a nice cleanup, since it allows us to a) not have a hardcoded
dependency of /tmp existing, b) it means that the temporary file is
removed after it's used automatically, and c) it allows us to test the
_make_profile function.
I would really prefer not to refactor without tests, but refactoring
is a requirement to test this function, so this needs to land before
tests.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This makes generating the profile a cleaner affair, and enables testing
it. It also pulls variables out of the global scope that don't belong in
the global scope.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
fix crash/warn handling.
cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Everything reported 'fail' all the time because interpretResult()
wasn't updated amdist all the Piglit framework rewriting.
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This uses the new exceptions and new PiglitConfig methods.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This creates two separate modules for these classes.
Making this change allows us to separate the basic building blocks of
Test classes and the concrete implementations.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This moves all of the classes that derive from Test into a package
called test. This patch looks very large, but is mostly just moving
files around and changing imports to account for this.
So why all of this code churn? The big advantage is that through
__init__.py magic there is one module to be imported, framework.test.
This module contains all of the public classes, functions, and
constants, in one place while hiding the rest, but allowing them to be
accessed explicitly.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Instead of symlinking oglconform into the bin/ dir, edit piglit.conf and
set the path key under the oglconform to the root of the oglconform dir.
v2: - change config key 'bindir' to 'path' (chadv)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
A number of methods in Test require to have stdout, the returncode and
the TestResult() instance passed into them. This is redundant since the
TestResult() instance already has all of that information in it. Since a
lot of methods need this information make the TestResult() an instance
attribute.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
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>
|
|
From python's PEP8:
"Function names should be lowercase, with words separated by
underscores as necessary to improve readability."
This patch was generated with the following shell command:
find . -name '*py' | xargs sed -i -e 's!interpretResult!interpret_result!g'
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
From python's PEP8:
"Constants are usually defined on a module level and written in all
capital letters with underscores separating words. Examples include
MAX_OVERFLOW and TOTAL."
This patch generated with the following shell command:
'find . -name '*py' | xargs sed -i -e 's!testBinDir!TEST_BIN_DIR!g'
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
Rather than have 2 base classes, let's just have one.
v2: - remove test that no longer is valid
v3: - fix igt using ExecTest instead of Test
- fix Test setting two different run methods
- fix piglit-print-commands.py, which also relied on ExecTest
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This is mostly consumed by Test's children, so putting it in the same
module makes sense. This should reduce the number of imports from core
as well, since most consumers of testBinDir also make use of ExecTest or
PlainExecTest.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
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)
|
|
Botched in commit cdfbf724df8c01eb4d7723abe73985594dd46550.
|