Age | Commit message (Collapse) | Author | Files | Lines |
|
In Python 2.6, the str.decode() function can't take keyword arguments,
so x.decode(y, errors=z) must be changed to x.decode(y, z). There is
no difference in functionality.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40051
|
|
To figure out where a test file belongs in the test hierarchy,
import_glsl_parser_tests has to determine the test file's path
relative to the "basepath" argument.
Before this patch, it worked out the relative path by dropping the
first three directories from the test file's path. This worked
because import_glsl_parser_tests was always called with a basepath
that contained exactly three directory names, e.g. "./spec/glsl-1.00".
But it was a fragile assumption.
This patch changes import_glsl_parser_tests so that it uses
os.path.relpath() to work out the relative path.
I've also taken the liberty of fixing a typo in the docstring
explaining how basebath is used, and I've changed
"assert(type(testname) is str)" to "assert isinstance(testname,
basestring)", which works properly with Unicode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
Due to a design flaw in Python 2.x, if an 8-bit string containing a
non-ASCII character is ever used in a context requiring a unicode
string, the Python interpreter will raise an exception. This happens
because Python lazily decodes 8-bit strings to unicode as needed, and
when it does the decoding it assumes the 8-bit string is in ASCII
format. Because of this lazy decoding behavior, this means
that 8-bit strings containing non-ASCII characters are unsafe in any
Python program that also uses unicode.
Since Python 3.x doesn't have 8-bit strings (it has "byte arrays",
which don't autoconvert to unicode strings), the most
forward-compatible way to address this problem is to find the source
of the unsafe 8-bit strings, and introduce an explicit decoding step
that translates them to unicode strings and handles errors properly.
This problem manifested in Piglit if the output of a test ever
contained a non-ASCII character. Due to Python 2.x's lazy string
decoding semantics, the exception wouldn't occur until attempting to
serialize the test output as JSON.
This patch introduces an explicit step, right after running a test,
which decodes the test output from 8-bit strings into unicode. The
decoding assumes UTF-8, and silently replaces invalid UTF-8 sequences
with the unicode "replacement character" rather than raise an
exception.
|
|
Each of these classes are essentially the same, except for:
1. How to determine whether the test passed/failed
2. Setting up the command and options
All the logic for running the command and obtaining its output can be
shared, as well as the logic to determine if it trapped/aborted/etc.
This patch creates a new 'ExecTest' base class. Subclasses can set the
exact command to run and options in their __init__ method, and must
supply an 'interpretResult' method which reads the output and sets
results['result'] to pass/fail (along with other desired annotations).
v2: Update for JSON related changes and ensure that output stays the
same. (Piglit and Glean are identical; GTF now includes the command
that was run but is otherwise equivalent.)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
This is no longer necessary thanks to the JSON rework.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
-c bool, --concurrent=bool Enable/disable concurrent test runs. Valid
option values are: 0, 1, on, off. (default: on)
CC: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
If the JSON result file was not closed properly, perhaps due a system
crash during a test run, then TestrunResult.parseFile will attempt to
repair the file before parsing it.
The repair is performed on a string buffer, and the result file is never
written to. This allows the result file to be safely read during a test
run.
CC: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
Factor out from TestrunResult.parseFile the code that checks if the file
is in the old format. Place that code into a separate method,
__checkFileIsNotInOldFormat.
CC: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
When a test run is interrupted, perhaps by a system crash, we often want
the test results. To accomplish this, Piglit must write each test result
to the result file as the test completes.
If the test run is interrupted, the result file will be corrupt. This is
corrected in a subsequent commit.
CC: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
JSONWriter writes to a JSON file stream.
It will be used by a subsequent commit to write each test result to the
result file as the test completes.
CC: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
|
|
If TestrunResult.parseFile is passed a file in the old, pre-json format,
then raise ResultFileInOldFormatError.
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
The results file produced by piglit-run.py contains a serialized
TestrunResult, and the serialization format was horridly homebrew. This
commit replaces that insanity with json.
Benefits:
- Net loss of 113 lines of code (ignoring comments and empty lines).
- By using the json module in the Python standard library, serializing
and unserializing is nearly as simple as `json.dump(object, file)`
and `json.load(object, file)`.
- By using a format that is easy to manipulate, it is now simple to
extend Piglit to allow users to embed custom data into the results
file.
As a side effect, the summary file is no longer needed, so it is no longer
produced.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
Because we shouldn't penalize anyone for using the underscore as
a separator.
Signed-off-by: Chad Versace <chad@chad-versace.us>
|
|
When reading in test run results we were mistakenly not decoding
escape sequences inside arrays. This resulted in occasional extra
backslashes in lists such as "errors" and "errors_ignored".
Reviewed-by: Chad Versace <chad@chad-versace.us>
|
|
|
|
The rest of piglit assumes that forward slash is the separator for the
group name. This patch fixes the summary HTML results on Windows. Tests
are now properly displayed in subgroups instead of the entire group name
listed as part of the test name.
|
|
|
|
|
|
|
|
Same as regressions if you reverse the order of columns.
|
|
This is basically a subset of 'changes'.
The regression is if a test result changes from either 'pass' or 'skip'
to something other than 'pass' and 'skip'. Thus the relation is:
{ pass, skip } -> { warn, fail, trap, abort, crash }
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
To distiguish between 'fail' and unexpected termination.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Chad Versace <chad.versace@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
Signed-off-by: Chad Versace <chad.versace@intel.com>
|
|
To run Piglit with an out-of-tree build, set the environment variable
PIGLIT_BUILD_DIR. For example:
$ env PIGLIT_BUILD_DIR=/path/to/piglit/build/dir \
./piglit-run.py tests/sanity.tests results/sanity.results
Signed-off-by: Chad Versace <chad.versace@intel.com>
|
|
Replaced poolName in the Test constructor with runConcurrent
boolean option. runConcurrent defaults to False. When True, the
Test pushes its doRunWork to the ConcurrentTestPool to be executed
in another thread. When False, doRunWork is executed immediately
on the calling thread (main thread).
Reviewed-by: Chad Versace <chad.versace@intel.com>
|
|
Remove ThreadPools from threads module since it is no longer
needed/used. ConcurrentTestPool is now the only threadpool needed
to manage cpu-only tests.
Reviewed-by: Chad Versace <chad.versace@intel.com>
|
|
This is an intermediate change that moves the "base" (or gpu)
tests to the main thread and the other (cpu-only) tests to the
ConcurrentTestPool threads. This restores ctrl-c behavior for
gpu tests.
Reviewed-by: Chad Versace <chad.versace@intel.com>
|
|
The ConcurrentTestPool singleton will simplify the threading model
and remove the need to manage multiple ThreadPools. Only one
threadpool is currently needed at this time and is meant to execute
cpu-only tests in separate threads.
Reviewed-by: Chad Versace <chad.versace@intel.com>
|
|
|
|
Respond to KeyboardInterrupt exception so that execution can
clean up and write a summary file before shutting down.
|
|
Add SyncFileWriter class to synchronize writes to the 'main' results
file from multiple threads. This helps to ensure that writes to this
file are not intermingled.
|
|
Modify Test class to use ThreadPools in its doRun method. All
tests now execute in the default ThreadPool named 'base'.
A Test instance can be configured to run in a different (named)
ThreadPool instance by setting its poolName member variable to
that name.
|
|
Add synchronization decorator to Logger functions for multithreaded
logging support.
|
|
Add threads.py which defines a synchronization decorator that will
be used for multithreaded synchronized access to critical sections.
Also defines a ThreadPools singleton that manages named ThreadPool
instances. A ThreadPool instance named 'base' is created by default
with one worker thread. New uniquely named ThreadPool instances
can be created with a configurable number of worker threads.
|
|
Add threadpool.py to support future concurrency support.
|
|
Added log.py which includes a simple Logger class that wraps some
basic functions from the Python logging module. The log wrapper
simplifies setup and will accommodate thread synchronization in the
future. Test::doRun now uses the new log facility.
NOTE: this changes the format of the 'test progress' previously
printed via stdout.
Added patterns.py which includes a Singleton class design pattern
to support the Logger class. Future design patterns can be added
to this file.
Tested with Python 2.7 on Linux. All should be compatible with
Windows and Mac and most earlier widely-used versions of Python.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
|
|
This reverts commit 3fd587bcd8efa12baa65ef59f7ac527199b31f12.
The email that precipitated the revert:
On 01/27/2011 11:52 AM, Ian Romanick wrote:
I don't understand why it is useful / necessary to have this in the
test. If you're trying to test driver features while they're being
implemented, you can / should do this by hand. If you're not trying to
test driver features while they're being implemented, you don't any
this to happen behind your back.
|
|
The option manually enables or disables extensions via the environment
variable MESA_EXTENSION_OVERRIDE.
|
|
... and update all test file using the option.
The new name makes clear what the option does.
|
|
Replace functional, stateless style with more traditional stateful style.
This does not alter the public behavior of GLSLParserTest nor Piglit test
results.
Storytime: When I initially wrote GLSLParserTest, I attempted to use
a functional style in which the class maintained a minimal amount of
state. Now that I have a need to modify the class, I realize how unsuited
the stateless style is to Python. I atone for my function sins :)
|
|
made TestResults::write() thread-safe by writing results in one
chunk to the file so that when threaded tests are implemented
there will be no interleaving.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
This test class feeds a GLSL source file to the glslparsertest executable.
Information about the test (such as expected result and GL requirments) may be
placed directly in the shader source file as a specially formatted comment
block.
Also, modify PlainExecTest to skip tests for which 'command == None'. This
prevents glslparsertests that lack a config section from failing in odd ways.
|
|
Store the command during object creation but append the global
parameters, which can be changed, at runtime.
|