[Piglit] cleanup oglconform v2

2015-10-26 Thread baker . dylan . c
This is exactly as the previous incarnation, except that it replaces the 'str in str' patch with a patch that makes interpret_result faster in most cases (instead of slightly slower). ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.free

[Piglit] [PATCH v2 1/9] tests/oglconform.py: wrap profile creation in a function

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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 --- tests/oglconform.py | 35 --- 1 file changed, 20 i

[Piglit] [PATCH v2 5/9] tests/oglconform.py: minor refactor to simplify try/except block

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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 add

[Piglit] [PATCH v2 9/9] tests/oglconform.py: make interpret_result() faster in most cases

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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

[Piglit] [PATCH v2 8/9] tests/oglconform.py: fix imports

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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 --- tests/oglconform.py | 3 ++- 1 file changed, 2 inserti

[Piglit] [PATCH v2 7/9] tests/oglconform.py: simplify writing to /dev/null

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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 --- tests/oglconform.py | 4 ++-- 1 file c

[Piglit] [PATCH v2 6/9] tests/oglconform.py: Fix style issues indentified by pylint

2015-10-26 Thread baker . dylan . c
From: Dylan Baker Fixes the following warnings from pylint: - constants should be ALL_CAPS - shadowing names from the outer scope Signed-off-by: Dylan Baker Reviewed-by: Vinson Lee --- tests/oglconform.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/t

[Piglit] [PATCH v2 3/9] framework/tests/oglconform_tests.py: Add tests for tests/oglconform.py

2015-10-26 Thread baker . dylan . c
From: Dylan Baker This adds a pretty extensive set of tests for oglconform.py, with the goal of making further cleanups and refactors easier and not introducing regressions. This adds a dependency of mock for the unittests. No production code needs this dependency, so this wont affect most (any?

[Piglit] [PATCH v2 2/9] tests/oglconform.py: Use tempfile module instead of hard-coded filename

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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

[Piglit] [PATCH v2 4/9] tests/oglconform.py: override command.getter

2015-10-26 Thread baker . dylan . c
From: Dylan Baker 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 --- tests/oglconform

Re: [Piglit] [PATCH v2 6/6] framework/test/base.py: use subprocess32 for timeouts.

2015-10-26 Thread Dylan Baker
On Mon, Oct 26, 2015 at 04:08:44PM +, Thomas Wood wrote: > On 24 October 2015 at 02:17, wrote: > > From: Dylan Baker > > [snip] > > -# The setter handles the bytes/unicode conversion > > -self.result.out = out > > -self.result.err = err > > -se

Re: [Piglit] [PATCH v2 6/6] framework/test/base.py: use subprocess32 for timeouts.

2015-10-26 Thread Thomas Wood
On 24 October 2015 at 02:17, wrote: > From: Dylan Baker > > Subprocess32 provides a backport of (ironically) python 3.3's subprocess > module, which has a timeout parameter. When the timeout runs out then an > exception is raised, and when that exception is caught we can kill the > process. > >

Re: [Piglit] [PATCH] cl-api-create-context: Remove unused variables.

2015-10-26 Thread Serge Martin
On Thursday 22 October 2015 22:46:27 Vinson Lee wrote: > create-context.c:141:15: warning: unused variable 'num_platform_ids' > [-Wunused-variable] unsigned int num_platform_ids; > ^ > create-context.c:139:7: warning: unused variable 'found_invalid_platform' > [-Wunused-variabl