Age | Commit message (Collapse) | Author | Files | Lines |
|
Like the glx tests/utility code, but for wgl.
Note, one must set the PIGLIT_PLATFORM env var to "wgl" before running
Piglit. It looks like there's some Waffle work to look at before this
can be made automatic.
|
|
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
The copyright notice was slightly different than most of the framework,
(mostly things like "author(s)" vs "authors or copyright holders"), and
the line length was different.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This allows check_dir to fulfill the needs of the overwrite switch in
the main run function.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This allows callers that don't want to fail to leave the keyword out. It
doesn't affect those that set it to true.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This is the PEP8 proper format for the name, and since piglit tries to
conform to PEP8 as practical it makes sense to rename this. It is pretty
much the non-PEP8 named function in piglit.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This requires each caller that sets failifexists=True to handle the
error, but it allows them to set a custom message or handle the failure
themselves, rather than just bailing. This makes the function more
generically useful, and removes a layering violation.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This is cleaner and more in keeping with the style of piglit.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This isn't exactly idiomatic, but makedirs can be *very slow*,
especially if the path is long and exists completely. By checking before
creating, and recovering from expected errors this function can be fast
and safe.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This simplifies the function.
|
|
This is cleaner and idiomatic.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
|
|
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>
|
|
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>
|
|
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 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>
|
|
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>
|
|
This adds extra information to determine the intel gt slice.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This is the plunge to change over from the old options model to the new
one. After this change Options is a global value, and no more passing or
creation of new instances is done (except for testing).
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
It's like glxinfo or wglinfo, but for OpenCL.
Reviewed-by: Serge Martin <edb+piglit@sigluy.net>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This is in keeping with the way that configparser.get() works in python3
(although there are some corner case differences since in python3 it
uses keyword only arguments, which don't exist in python2).
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Thomas Wood <thomas.wood@intel.com>
|
|
This class lazily evaluates regressions, problems, etc; and caches the
results. This generates a set or list of sets containing the names of
the tests, and a count of the number of tests.
This also adds a new decorator, the lazy_property. This is a very clever
Descriptor class, that adds the calculated value to the instance (while
the descriptor itself belongs to the class) under the same name, thus
shadowing itself. This means that the calculation of the Descriptor is
done once, and then stored, making any method decorated with this class
lazy.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This makes the code a little cleaner and easier to read.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This reverts commit 992bbcec39c335892c2c618fe3923a6a0ce6ffa4.
|
|
With the previous change there is only one user of checkDir, which was
in need of refactor if it was going to be generally useful.
So instead, just remove it, the replacement is less code and it's
obvious what it does.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This allows us to encapsulate a lot of the error handling logic into a
single place with easy to use methods. This should reduce the amount of
code in consumers of PIGLIT_CONFIG.
It adds two new methods, safe_get and required_get, which operate on
NoOptionError or NoSectionError. With safe_get, if either of these is
raised None will be return, for required_get a PiglitFatalError will be
raised.
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>
|
|
As of ea381355a0625a1 all test names were stored lowercase. The reasons
for this are outlined in that commit message, and while the summary was
updated to correctly handle these changes the -x and -i options to
piglit run were not.
This patch fixes the problem by altering the regex created from the
values passed to be case insensitive. It also adds a testcast to the
nost tests to demonstrate the fix.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
|
|
Makes 2 changes, all of which should have absolutely zero effect
1) breaks the imports into three newline separated groups: builtins,
installed modules, local modules
2) use print_function and absolute_import in all modules.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This allows the PLATFORMS list to be readily shared, and will be used in
the next patch.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
This refactors the log module away from a single class that does
everything to having two classes. The first class LogFactory, is a state
manager that returns BaseLog derived objects when it's get() method is
called. However, it mainly acts as a shared state manager.
The BaseLog derived classes provide three public methods; start(),
log(), summary().
This makes the interfaces much cleaner, just 3 public methods that are
fairly obvious and clearly documented. It uses inheritance for more
shared code, and is just generally much less complex than the previous
implementation
The use of a non-recursive lock mandates that the majority of the code
be in un-locked protected methods, while the public method takes the
lock, otherwise inheritance is nearly impossible.
v2: - Fix summary line in the verbose logger to support using '\r'. This
works by printing the summary at the end of start() and log()
- add -v/--verbose option back (Ilia)
v3: - Be more aggressive about locking
v4: - be more granular with locking by using two locks, one for
printing, one for manipulating the shared data.
- Move some unit tests to the next patch that belong there.
v5: - simplify the locking. This may have a performance impact, but
makes the code much simpler. It should be possible to make the
locking finer grained later
v6: - Lock one additional command
v7: - fix bug in Test. Test did not call log.start() so verbose log
would print <status>: None
- replace RLock with Lock. This requires a little bit of refactoring
to make it work, since the lock cannot be called recursively
v8: - remove trailing whitespace
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
When creating an Options object, use the environment's PIGLIT_SOURCE_DIR
value when available.
Fixes spec/ARB_ES3_compatibility/oes_compressed_etc2_texture-miptree test
failures in Cywin.
Also, remove the MESA_DEBUG=silent setting. Piglit shouldn't care if
debug output is on/off (we stopped looking for Mesa error messages a
long time ago).
v2: simplify code with dict get() method and default value.
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
A bug was introduced in 9e0c3ee1, this fixes it.
Because the get_config needs to find the piglit root, it has a hard
coded path to look for <current file>/../.. which worked when it was in
framework/programs/run.py, but in the mentioned commit the function was
moved to framework/core.py, a level down, so the hard coded path no
longer worked. This patch removes a '..', so the function now searches
for the right depth.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
Currently while running igt tests a kernel panic causes the results json
file to lose all data. This patch adds a command line option (-s,
--sync) that syncs the file descriptor to disk after every test allowing
data to persist through hard crashes.
v2: Call flush() before fsync(), explicitly pass fileno instead of fd
v3: sync write_dict_key added
v4: git log maintenance
v5: - Fix one unit test for JSONWriter, the constructor signature changed
(Dylan)
Reviewed-by: Dylan Baker <dylanx.c.baker@intel.com>
|
|
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
This warning annoys some people, and it isn't strictly necessary, so I
guess it should go.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
Move framework.programs.run._get_config() to framework.core.get_config() so
that it can be used elsewhere.
v2: set a default value for the get_config argument and fix function
call in integration_tests.py (Dylan Baker)
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
Catch subprocess.CalledProcessError, which is an exception that
subprocess.check_call() raises if the binary returns a non 0 status.
The usual culprit for this is glxinfo on systems not running X
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
|
|
This splits results code out of core into its own module. This makes the
code cleaner and easier to understand, and is groundwork for coming
patches.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
Environment doesn't really describe what the class is (although,
honestly it's a pretty bad class design), but Options comes much closer
to what it is.
v7: - update piglit-print-commands.py
- replace instance name 'env' with 'opts'
- rename Test.ENV to Test.OPTS
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
This replaces assignment followed by for loops with list comprehensions.
This is less code, simpler, and faster.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
Environment.collectData() is strange and awful for a host of reasons.
1) Its implementation was such that it should have been a static method,
but it wasn't
2) It wasn't at all related to Environment
3) It used a public helper which it was the sole consumer of.
Replacing it with a top level function makes a lot more sense for all of
these reason. This function has another major advantage, it assumes
nothing. In the former implementation it was assumed that specific
operating systems had specific tools available, and that those tools
were only available on that platform. This implementation doesn't assume
that, instead it makes a blind leap that the tools is available, and
then is caught if its wrong.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
There are some problems with using os.environ, all of which are caused
shell child-variable relationships. Most of these problems are easy to
solve, since we don't actually need to have environment variables set
except during test execution, and that can be passed to Popen (or it's
helper wrappers). This gives us much better assurance that things are
happening in the way we expect.
v7: - use itertools.chain instead of nested iterations
- fix piglit.conf default case
- reorder environment overrides so that variables passed in by the
user (or exported) override the builtin values instead of
vice-versa
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
After profile was split out of the core module it's imports were not
removed. This has a small overhead cost and drive the code quality
checking tools crazy.
__all__ is a module name that controls the values exported when running
help() or pydoc. Setting these to reflect proper values helps python
tools to function better and makes the documentation accurate.
None of these changes affect running code at all.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
|
|
There is a potential for some very odd bugs because of the way python
handles mutable arguments.
Consider this:
def foo(defaults=[]):
defaults.append('a')
return defaults
Calling foo(['bar']) will do the expected thing:
>>> foo(['bar'])
['bar', 'a']
But calling foo() will not:
>>> foo()
['a']
>>> foo()
['a', 'a']
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>
|
|
Group is a subclass of dict, with no overrides. This is silly and
confusing, it's a dictionary, just use a dictionary. This has the
additional advantage of removing a lot of spaghetti dependency issues,
since nearly every module needed access to Group()
Most of this was done with the shell command:
find . -name '*py' | xargs sed -i -e 's!Group()!{}!g'
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!runConcurrent!run_concurrent!g'
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
|
|
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>
|