[Piglit] [PATCH 04/20] unittests: split utils module

2016-06-01 Thread Dylan Baker
---
 unittests/backends_tests.py |  16 +--
 unittests/base_tests.py |  35 +++---
 unittests/compressed_backend_tests.py   |  54 -
 unittests/core_tests.py |  30 ++---
 unittests/deqp_tests.py |  26 ++---
 unittests/dmesg_tests.py|   6 +-
 unittests/exceptions_tests.py   |   2 +-
 unittests/generators/test_generators.py |   6 +-
 unittests/generators/test_glsl.py   |  12 +-
 unittests/gleantest_tests.py|   6 +-
 unittests/glsl_parser_test_tests.py |  44 
 unittests/grouptools_tests.py   |   4 +-
 unittests/gtest_tests.py|   2 +-
 unittests/json_backend_tests.py |  54 -
 unittests/json_results_update_tests.py  |  32 +++---
 unittests/json_tests.py |  18 +--
 unittests/junit_backends_tests.py   |  34 +++---
 unittests/log_tests.py  |   8 +-
 unittests/monitoring_tests.py   |  16 +--
 unittests/oglconform_tests.py   |   4 +-
 unittests/opencv_tests.py   |   2 +-
 unittests/opengl_tests.py   |  52 -
 unittests/options_tests.py  |   2 +-
 unittests/piglit_test_tests.py  |   8 +-
 unittests/profile_tests.py  |  72 ++--
 unittests/results_tests.py  |   8 +-
 unittests/run_parser_tests.py   |  14 +--
 unittests/shader_test_tests.py  |  10 +-
 unittests/status_tests.py   |  22 ++--
 unittests/summary_common_tests.py   |   6 +-
 unittests/summary_console_tests.py  |   2 +-
 unittests/summary_html_tests.py |   2 +-
 unittests/test_lists.py |   2 +-
 unittests/utils/__init__.py |   1 +
 unittests/{utils.py => utils/nose.py}   | 180 +++---
 unittests/utils/piglit.py   | 189 
 36 files changed, 508 insertions(+), 473 deletions(-)
 create mode 100644 unittests/utils/__init__.py
 rename unittests/{utils.py => utils/nose.py} (70%)
 create mode 100644 unittests/utils/piglit.py

diff --git a/unittests/backends_tests.py b/unittests/backends_tests.py
index 81466ec..41eb5b6 100644
--- a/unittests/backends_tests.py
+++ b/unittests/backends_tests.py
@@ -67,7 +67,7 @@ def _registry_teardown():
 # Tests
 
 
-@utils.nose_generator
+@utils.nose.generator
 def test_get_backend():
 """ Generate tests to get various backends """
 # We use a hand generated list here to ensure that we are getting what we
@@ -101,7 +101,7 @@ def test_get_backend_notimplemented():
 
 
 @nt.with_setup(teardown=_registry_teardown)
-@utils.test_in_tempdir
+@utils.nose.test_in_tempdir
 def test_load():
 """backends.load(): works as expected.
 
@@ -130,7 +130,7 @@ def test_load():
 
 
 @nt.raises(backends.BackendError)
-@utils.test_in_tempdir
+@utils.nose.test_in_tempdir
 def test_load_unknown():
 """backends.load(): An error is raised if no modules supportes `extension`
 """
@@ -141,9 +141,9 @@ def test_load_unknown():
 backends.load(file_path)
 
 
-@utils.no_error
+@utils.nose.no_error
 @nt.with_setup(_notimplemented_setup, _registry_teardown)
-@utils.test_in_tempdir
+@utils.nose.test_in_tempdir
 def test_load_resume():
 """backends.load: works for resuming (no extension known)."""
 backends.BACKENDS['test_backend'] = backends.register.Registry(
@@ -162,7 +162,7 @@ def test_load_resume():
 
 @nt.raises(backends.BackendNotImplementedError)
 @nt.with_setup(_notimplemented_setup, _registry_teardown)
-@utils.test_in_tempdir
+@utils.nose.test_in_tempdir
 def test_load_notimplemented():
 """backends.load(): An error is raised if a loader isn't properly 
implmented.
 """
@@ -204,7 +204,7 @@ def test_set_meta_notimplemented():
 
 @nt.with_setup(_notimplemented_setup, _registry_teardown)
 @nt.raises(backends.BackendNotImplementedError)
-@utils.not_raises(backends.BackendError)
+@utils.nose.not_raises(backends.BackendError)
 def test_load_trailing_dot():
 """framework.backends.load: handles the result name ending in '.'
 
@@ -217,7 +217,7 @@ def test_load_trailing_dot():
 
 
 @nt.with_setup(_notimplemented_setup, _registry_teardown)
-@utils.test_in_tempdir
+@utils.nose.test_in_tempdir
 @nt.raises(backends.BackendError)
 def test_load_old():
 """backends.load(): Ignores files ending in '.old'
diff --git a/unittests/base_tests.py b/unittests/base_tests.py
index f788b60..1933d71 100644
--- a/unittests/base_tests.py
+++ b/unittests/base_tests.py
@@ -35,7 +35,6 @@ except ImportError:
 import six
 import nose.tools as nt
 from nose.plugins.attrib import attr
-import six
 
 try:
 import psutil
@@ -78,7 +77,7 @@ class TimeoutTest(Test):
 def test_run_return_early():
 """ Test.run() exits early when Test._run_command() has exception """
 def helper():
-raise utils.TestFailure("The test didn't return early")
+raise utils.nose.TestFailure("The test didn't return early")
 
 # 

Re: [Piglit] [PATCH 00/20] Windows fixes

2016-06-01 Thread Dylan Baker
Quoting Brian Paul (2016-06-01 17:10:30)
> On 06/01/2016 05:50 PM, Dylan Baker wrote:
> > I'm tired of breaking piglit on windows. This series add appveyor (and
> > travis too, why not get free Linux testing while we're at it?) support
> > to piglit for the python framework (it doesn't cover the generators at
> > the moment), and fixes unittests and code to work on windows, mostly
> > unittests because I'm sloppy with them, but hey.
> >
> > The final patch actually does fix a real bug, which is the known fcntl
> > issue. It's kind of a hack, since it only hides the error until a windows
> > user tries to use the monitoring code. Since to my knowledge there is no
> > one on windows using the monitoring module it gets everybody up and
> > running again without breaking the monitoring users on POSIX systems.
> >
> > This is available at my github:
> > https://github.com/dcbaker/piglit wip/appveyor-v2
> 
> I don't really grok all this code but it sounds fine to me.
> 
> In patch 3/20 there's a "acceel" typo in the commit msg.
> 
> FWIW, for the series, Acked-by: Brian Paul 
> 
> Thanks for doing this!
> 
> -Brian
> 

Ah spelling, how terrible I am at thee.

I've fixed the spelling problem locally, at this point I'll wait to see
if anyone else has comments and push in the morning (PDT) unless someone
objects.

Dylan


signature.asc
Description: signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 00/20] Windows fixes

2016-06-01 Thread Brian Paul

On 06/01/2016 05:50 PM, Dylan Baker wrote:

I'm tired of breaking piglit on windows. This series add appveyor (and
travis too, why not get free Linux testing while we're at it?) support
to piglit for the python framework (it doesn't cover the generators at
the moment), and fixes unittests and code to work on windows, mostly
unittests because I'm sloppy with them, but hey.

The final patch actually does fix a real bug, which is the known fcntl
issue. It's kind of a hack, since it only hides the error until a windows
user tries to use the monitoring code. Since to my knowledge there is no
one on windows using the monitoring module it gets everybody up and
running again without breaking the monitoring users on POSIX systems.

This is available at my github:
https://github.com/dcbaker/piglit wip/appveyor-v2


I don't really grok all this code but it sounds fine to me.

In patch 3/20 there's a "acceel" typo in the commit msg.

FWIW, for the series, Acked-by: Brian Paul 

Thanks for doing this!

-Brian

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 19/20] unittests: fix test that tries to unlink open file

2016-06-01 Thread Dylan Baker
Which works just fine on Linux and doesn't on Windows.

Signed-off-by: Dylan Baker 
---
 unittests/core_tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unittests/core_tests.py b/unittests/core_tests.py
index 0e55ca3..7cb6745 100644
--- a/unittests/core_tests.py
+++ b/unittests/core_tests.py
@@ -174,7 +174,7 @@ def test_piglit_root():
 f.write(_CONF_FILE)
 with utils.nose.chdir('..'):
 core.get_config()
-os.unlink('piglit.conf')
+os.unlink('piglit.conf')
 
 nt.ok_(core.PIGLIT_CONFIG.has_section('nose-test'),
msg='$PIGLIT_ROOT not found')
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 20/20] framework: guard POSIX specific code in monitoring module

2016-06-01 Thread Dylan Baker
Fixes running on windows.

cc: Brian Paul 
cc: Olivier Berthier 
Signed-off-by: Dylan Baker 
---

This is not the "right" solution, but it should get everyone up and
running again. Then we can hopefully sort out what the right solution is
and get that implemented.

 framework/monitoring.py   | 172 +-
 unittests/monitoring_tests.py |   5 ++
 2 files changed, 93 insertions(+), 84 deletions(-)

diff --git a/framework/monitoring.py b/framework/monitoring.py
index f178bd6..1060cc5 100644
--- a/framework/monitoring.py
+++ b/framework/monitoring.py
@@ -36,7 +36,6 @@ from __future__ import (
 )
 import abc
 import errno
-import fcntl
 import os
 import re
 
@@ -219,93 +218,98 @@ class BaseMonitoring(object):
 return line
 
 
-class MonitoringFile(BaseMonitoring):
-"""Monitoring from a file
+if os.name == 'posix':
+import fcntl
 
-This class is for monitoring the system from a file that
-can be a standard file or a locked file. The locked file
-algorithm uses fnctl, so it doesn't work on non Unix systems
 
-Arguments:
-is_locked -- True if the target is a locked file
+class MonitoringFile(BaseMonitoring):
+"""Monitoring from a file
 
-"""
-_is_locked = False
-
-def __init__(self, monitoring_source, regex, is_locked=False):
-"""Create a MonitoringFile instance"""
-self._last_message = None
-self._is_locked = is_locked
-super(MonitoringFile, self).__init__(monitoring_source, regex)
-
-def update_monitoring(self):
-"""Open the file and get the differences
+This class is for monitoring the system from a file that
+can be a standard file or a locked file. The locked file
+algorithm uses fnctl, so it doesn't work on non Unix systems
 
-Get the contents of the file, then calculate new messages.
-This implements also a specific method for reading locked files.
+Arguments:
+is_locked -- True if the target is a locked file
 
 """
+_is_locked = False
+
+def __init__(self, monitoring_source, regex, is_locked=False):
+"""Create a MonitoringFile instance"""
+self._last_message = None
+self._is_locked = is_locked
+super(MonitoringFile, self).__init__(monitoring_source, regex)
+
+def update_monitoring(self):
+"""Open the file and get the differences
+
+Get the contents of the file, then calculate new messages.
+This implements also a specific method for reading locked files.
+
+"""
+
+try:
+with open(self._monitoring_source, 'r') as f:
+lines = []
+if self._is_locked:
+# Create a duplicated file descriptor, this avoid lock
+fd = os.dup(f.fileno())
+# use I/O control for reading the lines
+fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
+
+while True:
+try:
+line = os.read(fd, 1024)
+if not line:
+break;
+except OSError as e:
+if e.errno == errno.EAGAIN:
+break
+else:
+raise e
+lines.append(line.decode("utf-8", "strict"))
+os.close(fd)
+
+else:
+lines = f.read().splitlines()
+
+f.close()
+
+# Find all new entries, do this by slicing the list of the
+# lines to only returns elements after the last element
+# stored. If there are not matches a value error is raised,
+# that means all of the lines are new
+l = 0
+for index, item in enumerate(reversed(lines)):
+if item == self._last_message:
+l = len(lines) - index  # don't include the 
matched element
+break
+self._new_messages = lines[l:]
+# Attempt to store the last element of lines,
+# unless there was no line
+self._last_message = lines[-1] if lines else None
+except Exception:
+# if an error occured, we consider there are no new messages
+self._new_messages = []
+pass
+
+
+class MonitoringLinuxDmesg(BaseMonitoring, LinuxDmesg):
+"""Monitoring on dmesg
+
+This class is for monitoring on the system dmesg. It's inherited
+

[Piglit] [PATCH 09/20] unittests: use utils.nose.chdir

2016-06-01 Thread Dylan Baker
This fixes a number of tests on windows, where being in a directory
prevents it from being deleted.

Signed-off-by: Dylan Baker 
---
 unittests/core_tests.py   | 18 ++
 unittests/junit_backends_tests.py | 12 +---
 unittests/utils/nose.py   |  7 +--
 3 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/unittests/core_tests.py b/unittests/core_tests.py
index 341663d..9c5949f 100644
--- a/unittests/core_tests.py
+++ b/unittests/core_tests.py
@@ -158,12 +158,10 @@ def test_config_home_fallback():
 def test_local():
 """core.get_config() finds ./piglit.conf"""
 with utils.nose.tempdir() as tdir:
-os.chdir(tdir)
-
-with open(os.path.join(tdir, 'piglit.conf'), 'w') as f:
-f.write(_CONF_FILE)
-
-core.get_config()
+with utils.nose.chdir(tdir):
+with open(os.path.join(tdir, 'piglit.conf'), 'w') as f:
+f.write(_CONF_FILE)
+core.get_config()
 
 nt.ok_(core.PIGLIT_CONFIG.has_section('nose-test'),
msg='./piglit.conf not found')
@@ -174,12 +172,8 @@ def test_piglit_root():
 """core.get_config() finds "piglit root"/piglit.conf"""
 with open('piglit.conf', 'w') as f:
 f.write(_CONF_FILE)
-return_dir = getcwd()
-try:
-os.chdir('..')
-core.get_config()
-finally:
-os.chdir(return_dir)
+with utils.nose.chdir('..'):
+core.get_config()
 os.unlink('piglit.conf')
 
 nt.ok_(core.PIGLIT_CONFIG.has_section('nose-test'),
diff --git a/unittests/junit_backends_tests.py 
b/unittests/junit_backends_tests.py
index aaad5bf..d5f753a 100644
--- a/unittests/junit_backends_tests.py
+++ b/unittests/junit_backends_tests.py
@@ -323,12 +323,10 @@ def test_load_folder_name():
 def test_load_default_name():
 """backends.junit._load: uses 'junit result' for name as fallback"""
 with utils.nose.tempdir() as tdir:
-os.chdir(tdir)
-
-filename = 'results.xml'
-with open(filename, 'w') as f:
-f.write(_XML)
-
-test = backends.junit.REGISTRY.load(filename, 'none')
+with utils.nose.chdir(tdir):
+filename = 'results.xml'
+with open(filename, 'w') as f:
+f.write(_XML)
+test = backends.junit.REGISTRY.load(filename, 'none')
 
 nt.assert_equal(test.name, 'junit result')
diff --git a/unittests/utils/nose.py b/unittests/utils/nose.py
index 701b567..1d1ba93 100644
--- a/unittests/utils/nose.py
+++ b/unittests/utils/nose.py
@@ -339,16 +339,11 @@ def test_in_tempdir(func):
 returns to the original directory after the test completes.
 
 """
-original_dir = getcwd()
-
 @functools.wraps(func)
 def wrapper(*args, **kwargs):
 with tempdir() as tdir:
-try:
-os.chdir(tdir)
+with chdir(tdir):
 return func(*args, **kwargs)
-finally:
-os.chdir(original_dir)
 
 return wrapper
 
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 12/20] unittests: fix compressor tests that fails on windows

2016-06-01 Thread Dylan Baker
These fail because they assumes that an xz binary is available, which is
probably not the case on windows. This splits the binary and module
tests, and makes the skipping actually work in all of the cases it needs
to (or at least more of the cases).

Signed-off-by: Dylan Baker 
---
 unittests/compressed_backend_tests.py | 28 
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/unittests/compressed_backend_tests.py 
b/unittests/compressed_backend_tests.py
index 80957e7..bf9af02 100644
--- a/unittests/compressed_backend_tests.py
+++ b/unittests/compressed_backend_tests.py
@@ -205,17 +205,37 @@ def test_bz2_output():
 nt.eq_(_test_extension(), '.bz2')
 
 
+@utils.nose.Skip.backport(3.0, 'backports.lzma')
 @utils.nose.no_error
-def test_compress_xz():
-"""framework.backends.compression: can compress to 'xz'"""
+def test_compress_xz_module():
+"""framework.backends.compression: can compress to 'xz' via module"""
 _test_compressor('xz')
 
 
-def test_decompress_xz():
-"""framework.backends.compression: can decompress from 'xz'"""
+@utils.nose.Skip.py3
+@utils.nose.Skip.module('backports.lzma', available=True)
+@utils.nose.Skip.binary('xz')
+@utils.nose.no_error
+def test_compress_xz_binary():
+"""framework.backends.compression: can compress to 'xz' via binary"""
+_test_compressor('xz')
+
+
+@utils.nose.Skip.backport(3.0, 'backports.lzma')
+def test_decompress_xz_module():
+"""framework.backends.compression: can decompress from 'xz' via module"""
+_test_decompressor('xz')
+
+
+@utils.nose.Skip.py3
+@utils.nose.Skip.module('backports.lzma', available=True)
+@utils.nose.Skip.binary('xz')
+def test_decompress_xz_binary():
+"""framework.backends.compression: can decompress from 'xz' via binary"""
 _test_decompressor('xz')
 
 
+@utils.nose.Skip.backport(3.0, 'backports.lzma')
 @mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'xz'})
 def test_xz_output():
 """framework.backends: when using xz compression a xz file is created"""
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 05/20] unittests: Make skip less invasive

2016-06-01 Thread Dylan Baker
I prefer that skip is just a decorator so that the test itself doesn't
need to contain code to skip.
---
 tox.ini   |   1 +
 unittests/base_tests.py   |  31 +++-
 unittests/compressed_backend_tests.py |  14 +---
 unittests/core_tests.py   |   6 +-
 unittests/json_tests.py   |  12 +--
 unittests/junit_backends_tests.py |   2 +-
 unittests/monitoring_tests.py |   8 +-
 unittests/profile_tests.py|   4 +-
 unittests/utils/nose.py   | 135 --
 9 files changed, 110 insertions(+), 103 deletions(-)

diff --git a/tox.ini b/tox.ini
index 901432e..d6a845f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,6 +9,7 @@ setenv =
 deps =
 nose
 coverage
+wrapt
 six==1.5.2
 accel: simplejson
 accel-nix: lxml
diff --git a/unittests/base_tests.py b/unittests/base_tests.py
index 1933d71..2058703 100644
--- a/unittests/base_tests.py
+++ b/unittests/base_tests.py
@@ -31,6 +31,10 @@ try:
 from unittest import mock
 except ImportError:
 import mock
+try:
+import subprocess32 as subprocess
+except ImportError:
+import subprocess
 
 import six
 import nose.tools as nt
@@ -87,6 +91,8 @@ def test_run_return_early():
 
 
 @attr('slow')
+@utils.nose.Skip.module('psutil', available=True)
+@utils.nose.Skip.backport(3.3, 'subprocess32')
 @nt.timed(6)
 def test_timeout_kill_children():
 """test.base.Test: kill children if terminate fails
@@ -97,13 +103,6 @@ def test_timeout_kill_children():
 This test could leave processes running if it fails.
 
 """
-utils.nose.module_check('psutil')
-if six.PY2:
-utils.nose.module_check('subprocess32')
-import subprocess32 as subprocess  # pylint: disable=import-error
-elif six.PY3:
-import subprocess
-
 class PopenProxy(object):
 """An object that proxies Popen, and saves the Popen instance as an
 attribute.
@@ -173,6 +172,8 @@ def test_timeout_kill_children():
 
 
 @attr('slow')
+@utils.nose.Skip.backport(3.3, 'subprocess32')
+@utils.nose.Skip.binary('sleep')
 @nt.timed(6)
 def test_timeout():
 """test.base.Test: Stops running test after timeout expires
@@ -181,37 +182,29 @@ def test_timeout():
 if the test runs 5 seconds it's run too long
 
 """
-if six.PY2:
-utils.nose.module_check('subprocess32')
-utils.nose.binary_check('sleep', 1)
-
 test = TimeoutTest(['sleep', '60'])
 test.timeout = 1
 test.run()
 
 
 @attr('slow')
+@utils.nose.Skip.backport(3.3, 'subprocess32')
+@utils.nose.Skip.binary('sleep')
 @nt.timed(6)
 def test_timeout_timeout():
 """test.base.Test: Sets status to 'timeout' when timeout exceeded"""
-if six.PY2:
-utils.nose.module_check('subprocess32')
-utils.nose.binary_check('sleep', 1)
-
 test = TimeoutTest(['sleep', '60'])
 test.timeout = 1
 test.run()
 nt.eq_(test.result.result, 'timeout')
 
 
+@utils.nose.Skip.backport(3.3, 'subprocess32')
+@utils.nose.Skip.binary('true')
 @nt.timed(2)
 def test_timeout_pass():
 """test.base.Test: Doesn't change status when timeout not exceeded
 """
-if six.PY2:
-utils.nose.module_check('subprocess32')
-utils.nose.binary_check('true')
-
 test = TimeoutTest(['true'])
 test.timeout = 1
 test.result.result = 'pass'
diff --git a/unittests/compressed_backend_tests.py 
b/unittests/compressed_backend_tests.py
index c3be896..18786c1 100644
--- a/unittests/compressed_backend_tests.py
+++ b/unittests/compressed_backend_tests.py
@@ -32,8 +32,6 @@ import os
 import functools
 
 import nose.tools as nt
-from nose.plugins.skip import SkipTest
-import six
 
 from . import utils
 from framework import results
@@ -233,20 +231,12 @@ def test_update_piglit_conf():
 nt.eq_(compression.get_mode(), 'foobar')
 
 
+@utils.nose.Skip.py3
+@utils.nose.Skip.module('backports.lzma', available=False)
 @utils.nose.set_env(PIGLIT_COMPRESSION='xz')
 @utils.nose.test_in_tempdir
 def test_xz_shell_override():
 """framework.backends.compression: the xz shell utility path can 
overwrite"""
-if six.PY3:
-raise SkipTest('Test is irrelvent on python 3')
-
-try:
-import backports.lzma  # pylint: disable=unused-variable
-except ImportError:
-pass
-else:
-raise SkipTest('Test requires shell path, not backports.lzma path.')
-
 with open('foo.json.xz', 'w') as f:
 f.write('foo')
 
diff --git a/unittests/core_tests.py b/unittests/core_tests.py
index 4d83e73..8a160e7 100644
--- a/unittests/core_tests.py
+++ b/unittests/core_tests.py
@@ -33,9 +33,9 @@ import textwrap
 # There is a very high potential that one of these will raise an ImportError
 # pylint: disable=import-error
 try:
-from unittest import mock
-except ImportError:
 import mock
+except ImportError:
+from unittest import mock
 # pylint: enable=import-error
 
 import nose.tools as nt
@@ -332,7 +332,7 @@ def 

[Piglit] [PATCH 11/20] unittests: Skip xz shell compressor test if there is no xz binary

2016-06-01 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 unittests/compressed_backend_tests.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/unittests/compressed_backend_tests.py 
b/unittests/compressed_backend_tests.py
index 8ff2b0c..80957e7 100644
--- a/unittests/compressed_backend_tests.py
+++ b/unittests/compressed_backend_tests.py
@@ -237,6 +237,7 @@ def test_update_piglit_conf():
 
 @utils.nose.Skip.py3
 @utils.nose.Skip.module('backports.lzma', available=False)
+@utils.nose.Skip.binary('xz')
 @mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'xz'})
 @utils.nose.test_in_tempdir
 def test_xz_shell_override():
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 00/20] Windows fixes

2016-06-01 Thread Dylan Baker
I'm tired of breaking piglit on windows. This series add appveyor (and
travis too, why not get free Linux testing while we're at it?) support
to piglit for the python framework (it doesn't cover the generators at
the moment), and fixes unittests and code to work on windows, mostly
unittests because I'm sloppy with them, but hey.

The final patch actually does fix a real bug, which is the known fcntl
issue. It's kind of a hack, since it only hides the error until a windows
user tries to use the monitoring code. Since to my knowledge there is no
one on windows using the monitoring module it gets everybody up and
running again without breaking the monitoring users on POSIX systems.

This is available at my github:
https://github.com/dcbaker/piglit wip/appveyor-v2

Dylan Baker (20):
  travis: Add travis.yml for python code
  appveyor.yml: Add appveyor for python code
  tox: split py27-accel for windows
  unittests: split utils module
  unittests: Make skip less invasive
  unittests/core_tests: use mock instead of hand spun decorator
  unittests: replace set_env decorator with mock
  unittests: add utility context manager for changing directories
  unittests: use utils.nose.chdir
  unittests: fix dmesg test that could not work on non-posix platforms
  unittests: Skip xz shell compressor test if there is no xz binary
  unittests: fix compressor tests that fails on windows
  unittests: skip test that only works on POSIX platforms
  unittests: fix monitoring tests.
  unittests: reimplement utility function to get a unique file to be
windows-safe
  unitttests: skip timeout test on windows
  framework: encode arguments to subprocess for python2 on windows
  unittests: make deqp tests work on windows by closing generator
  unittests: fix test that tries to unlink open file
  framework: guard POSIX specific code in monitoring module

 .travis.yml |  16 ++
 appveyor.yml|  55 +
 ci/appveyor/compiler.cmd|  46 
 framework/monitoring.py | 172 +++---
 framework/test/base.py  |  16 +-
 tox.ini |  16 +-
 unittests/backends_tests.py |  16 +-
 unittests/base_tests.py |  51 ++---
 unittests/compressed_backend_tests.py   | 101 +
 unittests/core_tests.py | 111 +++---
 unittests/deqp_tests.py |  30 +--
 unittests/dmesg_tests.py|  31 +--
 unittests/exceptions_tests.py   |   2 +-
 unittests/generators/test_generators.py |   6 +-
 unittests/generators/test_glsl.py   |  12 +-
 unittests/gleantest_tests.py|   6 +-
 unittests/glsl_parser_test_tests.py |  44 ++--
 unittests/grouptools_tests.py   |   4 +-
 unittests/gtest_tests.py|   2 +-
 unittests/json_backend_tests.py |  54 ++---
 unittests/json_results_update_tests.py  |  32 +--
 unittests/json_tests.py |  18 +-
 unittests/junit_backends_tests.py   |  46 ++--
 unittests/log_tests.py  |   8 +-
 unittests/monitoring_tests.py   |  56 +++--
 unittests/oglconform_tests.py   |   4 +-
 unittests/opencv_tests.py   |   2 +-
 unittests/opengl_tests.py   |  52 ++---
 unittests/options_tests.py  |   2 +-
 unittests/piglit_test_tests.py  |   8 +-
 unittests/profile_tests.py  |  72 +++---
 unittests/results_tests.py  |   8 +-
 unittests/run_parser_tests.py   |  14 +-
 unittests/shader_test_tests.py  |  10 +-
 unittests/status_tests.py   |  22 +-
 unittests/summary_common_tests.py   |   6 +-
 unittests/summary_console_tests.py  |   2 +-
 unittests/summary_html_tests.py |   2 +-
 unittests/test_lists.py |   2 +-
 unittests/utils/__init__.py |   1 +
 unittests/{utils.py => utils/nose.py}   | 381 ++--
 unittests/utils/piglit.py   | 189 
 42 files changed, 918 insertions(+), 810 deletions(-)
 create mode 100644 .travis.yml
 create mode 100644 appveyor.yml
 create mode 100644 ci/appveyor/compiler.cmd
 create mode 100644 unittests/utils/__init__.py
 rename unittests/{utils.py => utils/nose.py} (52%)
 create mode 100644 unittests/utils/piglit.py

-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 16/20] unitttests: skip timeout test on windows

2016-06-01 Thread Dylan Baker
This relies on and tests a linux (or maybe posix?) only feature, so skip
on windows.

Signed-off-by: Dylan Baker 
---
 unittests/base_tests.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/unittests/base_tests.py b/unittests/base_tests.py
index 2058703..2c3d99b 100644
--- a/unittests/base_tests.py
+++ b/unittests/base_tests.py
@@ -91,6 +91,7 @@ def test_run_return_early():
 
 
 @attr('slow')
+@utils.nose.Skip.platform('win32', is_=True)
 @utils.nose.Skip.module('psutil', available=True)
 @utils.nose.Skip.backport(3.3, 'subprocess32')
 @nt.timed(6)
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 18/20] unittests: make deqp tests work on windows by closing generator

2016-06-01 Thread Dylan Baker
The generator will otherwise hold the tempfile opened and cause an error
in the test.

Signed-off-by: Dylan Baker 
---
 unittests/deqp_tests.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/unittests/deqp_tests.py b/unittests/deqp_tests.py
index c237b81..7c1bd86 100644
--- a/unittests/deqp_tests.py
+++ b/unittests/deqp_tests.py
@@ -117,6 +117,7 @@ def test_iter_deqp_test_cases_test():
 with utils.nose.tempfile('TEST: a.deqp.test') as tfile:
 gen = deqp.iter_deqp_test_cases(tfile)
 nt.eq_('a.deqp.test', next(gen))
+gen.close()
 
 
 def test_iter_deqp_test_cases_group():
@@ -124,6 +125,7 @@ def test_iter_deqp_test_cases_group():
 with utils.nose.tempfile('GROUP: a group\nTEST: a.deqp.test') as tfile:
 gen = deqp.iter_deqp_test_cases(tfile)
 nt.eq_('a.deqp.test', next(gen))
+gen.close()
 
 
 @nt.raises(exceptions.PiglitFatalError)
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 03/20] tox: split py27-accel for windows

2016-06-01 Thread Dylan Baker
Some parts of the accel profile don't work on windows (or don't work
easily) such as lxml and subprocess32. Because of this create two
separate acceel profiles, one for windows and one for posix platforms.

Signed-off-by: Dylan Baker 
---
 tox.ini | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tox.ini b/tox.ini
index d70d5d8..901432e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,20 +1,21 @@
 [tox]
-envlist = py{27,33,34,35}-{generator,noaccel,accel}
-skipsdist=True
-
+envlist = py{27,33,34,35}-{generator,noaccel}, py{27,33,34,35}-accel-{win,nix}
+skipsdist = True
 
 [testenv]
 passenv=HOME
+setenv =
+USERNAME = foo
 deps =
 nose
 coverage
 six==1.5.2
 accel: simplejson
-accel: lxml
-py27-accel,py{33,34,35}-{accel,noaccel}: psutil
+accel-nix: lxml
+py27-accel-nix,py{33,34,35}-{accel,noaccel}: psutil
 py27-{accel,noaccel}: mock==1.0.1
-py27-accel: backports.lzma
-py27-accel: subprocess32
+py27-accel-nix: backports.lzma
+py27-accel-nix: subprocess32
 py{27,33,34}: mako==0.8.0
 py35: mako==1.0.2
 generator: numpy==1.7.0
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 10/20] unittests: fix dmesg test that could not work on non-posix platforms

2016-06-01 Thread Dylan Baker
The test would try to initialize a linuxDmesg even on windows, which
obviously wouldn't work, since there is not /dev/kmesg on windows. The
test is a little hacky anyways, and better tested using appveyor for
windows testing. The updated test just tests that the currently platform
returns the right thing.

Signed-off-by: Dylan Baker 
---
 unittests/dmesg_tests.py | 27 +--
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/unittests/dmesg_tests.py b/unittests/dmesg_tests.py
index 0b0490d..18fa361 100644
--- a/unittests/dmesg_tests.py
+++ b/unittests/dmesg_tests.py
@@ -29,6 +29,7 @@ from __future__ import (
 absolute_import, division, print_function, unicode_literals
 )
 import re
+import sys
 import warnings
 
 try:
@@ -37,7 +38,6 @@ except ImportError:
 import mock
 
 import nose.tools as nt
-import six
 
 from . import utils
 from framework import dmesg, status, results, exceptions
@@ -280,24 +280,15 @@ def test_dummydmesg_update_result():
 nt.eq_(result.result, mock.sentinel.result)
 
 
-@utils.nose.generator
+@utils.nose.Skip(sys.platform.startswith('win32') or 
sys.platform.startswith('linux'),
+ 'Dmesg support unimplemented for platfor 
{}'.format(sys.platform))
 def test_get_dmesg():
-"""Generate tests for get_dmesg."""
-tests = [
-('linux', dmesg.LinuxDmesg),
-# There is no dmesg on windows, thus it will always get the dummy
-('win32', dmesg.DummyDmesg),
-]
-description = 'dmesg.get_dmesg: returns correct class when platform is {}'
-
-def test(platform, class_):
-with mock.patch('framework.dmesg.sys.platform', platform):
-ret = dmesg.get_dmesg()
-nt.assert_is_instance(ret, class_)
-
-for platform, class_ in tests:
-test.description = description.format(platform)
-yield test, platform, class_
+"""dmesg.get_dmesg: Returns correct class for platform"""
+ret = dmesg.get_dmesg()
+if sys.platform.startswith('win32'):
+nt.ok_(ret is dmesg.DummyDmesg)
+elif sys.platform.startswith('linux'):
+nt.ok_(ret is dmesg.LinuxDmesg)
 
 
 def test_get_dmesg_dummy():
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 17/20] framework: encode arguments to subprocess for python2 on windows

2016-06-01 Thread Dylan Baker
Subprocess from Python 2 on windows is an interesting beast. The way
it's implemented is a little strange, and passing environment variables
as unicode breaks things. It works fine on POSIX, however. So for
windows convert to binary.

Signed-off-by: Dylan Baker 
---
 framework/test/base.py | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index ff129ed..0d5fc1e 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -302,12 +302,16 @@ class Test(object):
 # Piglit considers environment variables set in all.py (3) to be test
 # requirements.
 #
-fullenv = dict()
-for key, value in itertools.chain(six.iteritems(os.environ),
-  six.iteritems(options.OPTIONS.env),
-  six.iteritems(self.env)):
-fullenv[key] = str(value)
-
+# passing this as unicode is basically broken in python2 on windows, it
+# must be passed a bytes.
+if six.PY2 and sys.platform.startswith('win32'):
+f = six.binary_type
+else:
+f = six.text_type
+_base = itertools.chain(six.iteritems(os.environ),
+six.iteritems(options.OPTIONS.env),
+six.iteritems(self.env))
+fullenv = {f(k): f(v) for k, v in _base}
 
 try:
 proc = subprocess.Popen(self.command,
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 13/20] unittests: skip test that only works on POSIX platforms

2016-06-01 Thread Dylan Baker
Tildes are not expanded as $HOME on windows, so don't run that test on
windows.

Signed-off-by: Dylan Baker 
---
 unittests/core_tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unittests/core_tests.py b/unittests/core_tests.py
index 9c5949f..0e55ca3 100644
--- a/unittests/core_tests.py
+++ b/unittests/core_tests.py
@@ -106,7 +106,7 @@ class Test_parse_listfile_TrailingWhitespace(object):
 nt.assert_equal(self.results[2], "/tmp/foo",
 msg="Trailing tabs not removed!")
 
-
+@utils.nose.Skip.platform('win32', is_=True)
 def test_parse_listfile_tilde():
 """core.parse_listfile(): tildes (~) are properly expanded.
 
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 07/20] unittests: replace set_env decorator with mock

2016-06-01 Thread Dylan Baker
---
 unittests/compressed_backend_tests.py | 20 
 unittests/deqp_tests.py   | 12 ++--
 unittests/utils/nose.py   | 35 ---
 3 files changed, 18 insertions(+), 49 deletions(-)

diff --git a/unittests/compressed_backend_tests.py 
b/unittests/compressed_backend_tests.py
index 18786c1..8ff2b0c 100644
--- a/unittests/compressed_backend_tests.py
+++ b/unittests/compressed_backend_tests.py
@@ -32,6 +32,10 @@ import os
 import functools
 
 import nose.tools as nt
+try:
+import mock
+except ImportError:
+from unittest import mock
 
 from . import utils
 from framework import results
@@ -146,21 +150,21 @@ def test_decompress_none():
 
 
 @_add_compression('foobar')
-@utils.nose.set_env(PIGLIT_COMPRESSION='foobar')
+@mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'foobar'})
 def testget_mode_env():
 """framework.backends.compression.get_mode: uses PIGlIT_COMPRESSION 
environment variable"""
 nt.eq_(compression.get_mode(), 'foobar')
 
 
 @_add_compression('foobar')
-@utils.nose.set_env(PIGLIT_COMPRESSION=None)
+@mock.patch.dict('os.environ', {}, True)
 @utils.piglit.set_piglit_conf(('core', 'compression', 'foobar'))
 def testget_mode_piglit_conf():
 """framework.backends.compression.get_mode: uses piglit.conf 
[core]:compression value if env is unset"""
 nt.eq_(compression.get_mode(), 'foobar')
 
 
-@utils.nose.set_env(PIGLIT_COMPRESSION=None)
+@mock.patch.dict('os.environ', {}, True)
 @utils.piglit.set_piglit_conf(('core', 'compression', None))
 def testget_mode_default():
 """framework.backends.compression.get_mode: uses DEFAULT if env and 
piglit.conf are unset"""
@@ -178,7 +182,7 @@ def test_decompress_gz():
 _test_decompressor('gz')
 
 
-@utils.nose.set_env(PIGLIT_COMPRESSION='gz')
+@mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'gz'})
 def test_gz_output():
 """framework.backends: when using gz compression a gz file is created"""
 nt.eq_(_test_extension(), '.gz')
@@ -195,7 +199,7 @@ def test_decompress_bz2():
 _test_decompressor('bz2')
 
 
-@utils.nose.set_env(PIGLIT_COMPRESSION='bz2')
+@mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'bz2'})
 def test_bz2_output():
 """framework.backends: when using bz2 compression a bz2 file is created"""
 nt.eq_(_test_extension(), '.bz2')
@@ -212,14 +216,14 @@ def test_decompress_xz():
 _test_decompressor('xz')
 
 
-@utils.nose.set_env(PIGLIT_COMPRESSION='xz')
+@mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'xz'})
 def test_xz_output():
 """framework.backends: when using xz compression a xz file is created"""
 nt.eq_(_test_extension(), '.xz')
 
 
 @_add_compression('foobar')
-@utils.nose.set_env(PIGLIT_COMPRESSION=None)
+@mock.patch.dict('os.environ', {}, True)
 @utils.piglit.set_piglit_conf(('core', 'compression', 'foobar'))
 def test_update_piglit_conf():
 """framework.backends.compression: The compression mode honors updates to 
piglit.conf.
@@ -233,7 +237,7 @@ def test_update_piglit_conf():
 
 @utils.nose.Skip.py3
 @utils.nose.Skip.module('backports.lzma', available=False)
-@utils.nose.set_env(PIGLIT_COMPRESSION='xz')
+@mock.patch.dict('os.environ', {'PIGLIT_COMPRESSION': 'xz'})
 @utils.nose.test_in_tempdir
 def test_xz_shell_override():
 """framework.backends.compression: the xz shell utility path can 
overwrite"""
diff --git a/unittests/deqp_tests.py b/unittests/deqp_tests.py
index b0e314f..c237b81 100644
--- a/unittests/deqp_tests.py
+++ b/unittests/deqp_tests.py
@@ -53,7 +53,7 @@ class _DEQPTestTest(deqp.DEQPBaseTest):
 
 
 @utils.piglit.set_piglit_conf(('deqp_test', 'test_env', 'from conf'))
-@utils.nose.set_env(_PIGLIT_TEST_ENV='from env')
+@mock.patch.dict('os.environ', {'_PIGLIT_TEST_ENV': 'from env'})
 def test_get_option_env():
 """deqp.get_option: if env is set it overrides piglit.conf"""
 nt.eq_(deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'test_env')),
@@ -61,14 +61,14 @@ def test_get_option_env():
 
 
 @utils.piglit.set_piglit_conf(('deqp_test', 'test_env', 'from conf'))
-@utils.nose.set_env(_PIGLIT_TEST_ENV=None)
+@mock.patch.dict('os.environ', {}, True)
 def test_get_option_conf():
 """deqp.get_option: if env is not set a value is taken from piglit.conf"""
 nt.eq_(deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'test_env')),
'from conf')
 
 
-@utils.nose.set_env(_PIGLIT_TEST_ENV=None)
+@mock.patch.dict('os.environ', {}, True)
 def test_get_option_default():
 """deqp.get_option: default value is returned when env and conf are unset
 """
@@ -77,7 +77,7 @@ def test_get_option_default():
'foobar')
 
 
-@utils.nose.set_env(_PIGLIT_TEST_ENV=None)
+@mock.patch.dict('os.environ', {}, True)
 def test_get_option_conf_no_section():
 """deqp.get_option: if a no_section error is raised and env is unset None 
is return
 """
@@ -86,8 +86,8 @@ def test_get_option_conf_no_section():
 
 # The first argument ensures the sectio exists
 

[Piglit] [PATCH 06/20] unittests/core_tests: use mock instead of hand spun decorator

2016-06-01 Thread Dylan Baker
Mock solves this problem nicely and removes code.
---
 unittests/core_tests.py | 59 +
 1 file changed, 6 insertions(+), 53 deletions(-)

diff --git a/unittests/core_tests.py b/unittests/core_tests.py
index 8a160e7..341663d 100644
--- a/unittests/core_tests.py
+++ b/unittests/core_tests.py
@@ -62,53 +62,6 @@ dir = foo
 """)
 
 
-def _save_core_config(func):
-"""Decorator function that saves and restores environment state.
-
-This allows the test to modify any protected state, and guarantees that it
-will be restored afterwords.
-
-Curerntly this protects a /piglit.conf, and $XDG_CONFIG_HOME
-and $HOME
-
-"""
-@functools.wraps(func)
-def inner(*args, **kwargs):
-"""Save and restore state."""
-saved_env = {}
-restore_piglitconf = False
-
-try:
-for env in ['XDG_CONFIG_HOME', 'HOME']:
-if env in os.environ:
-saved_env[env] = os.environ.pop(env)
-
-if os.path.exists('piglit.conf'):
-shutil.move('piglit.conf', 'piglit.conf.restore')
-restore_piglitconf = True
-core.PIGLIT_CONFIG = core.PiglitConfig(allow_no_value=True)
-except Exception as e:
-raise utils.nose.UtilsError(e)
-
-func(*args, **kwargs)
-
-try:
-for env in ['XDG_CONFIG_HOME', 'HOME']:
-if env in saved_env:
-os.environ[env] = saved_env[env]
-elif env in os.environ:
-del os.environ[env]
-
-if restore_piglitconf:
-shutil.move('piglit.conf.restore', 'piglit.conf')
-core.PIGLIT_CONFIG = core.PiglitConfig(
-allow_no_value=True)
-except Exception as e:
-raise utils.nose.UtilsError(e)
-
-return inner
-
-
 @utils.nose.no_error
 def test_PiglitConfig_init():
 """core.PiglitConfig: initializes"""
@@ -173,7 +126,7 @@ def test_parse_listfile_tilde():
msg='expected: {} but got: {}'.format(expected, results[0]))
 
 
-@_save_core_config
+@mock.patch('framework.core.os.environ', {})
 def test_xdg_config_home():
 """core.get_config() finds $XDG_CONFIG_HOME/piglit.conf"""
 with utils.nose.tempdir() as tdir:
@@ -186,7 +139,7 @@ def test_xdg_config_home():
msg='$XDG_CONFIG_HOME not found')
 
 
-@_save_core_config
+@mock.patch('framework.core.os.environ', {})
 def test_config_home_fallback():
 """core.get_config() finds $HOME/.config/piglit.conf"""
 with utils.nose.tempdir() as tdir:
@@ -196,11 +149,11 @@ def test_config_home_fallback():
 f.write(_CONF_FILE)
 core.get_config()
 
-nt.ok_(core.PIGLIT_CONFIG.has_section('nose-test'),
-   msg='$HOME/.config/piglit.conf not found')
+nt.ok_(core.PIGLIT_CONFIG.has_section('nose-test'),
+   msg='$HOME/.config/piglit.conf not found')
 
 
-@_save_core_config
+@mock.patch('framework.core.os.environ', {})
 @utils.nose.test_in_tempdir
 def test_local():
 """core.get_config() finds ./piglit.conf"""
@@ -216,7 +169,7 @@ def test_local():
msg='./piglit.conf not found')
 
 
-@_save_core_config
+@mock.patch('framework.core.os.environ', {})
 def test_piglit_root():
 """core.get_config() finds "piglit root"/piglit.conf"""
 with open('piglit.conf', 'w') as f:
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 02/20] appveyor.yml: Add appveyor for python code

2016-06-01 Thread Dylan Baker
This currently doesn't test building piglit (the C/C++ code), only the
python bits, and only the framework, not the generators. It's probably
worth adding support for all of that, but it's a more involved project,
and I'm just trying to not break the framework on windows anymore.

Signed-off-by: Dylan Baker 
---
 appveyor.yml | 55 
 ci/appveyor/compiler.cmd | 46 
 2 files changed, 101 insertions(+)
 create mode 100644 appveyor.yml
 create mode 100644 ci/appveyor/compiler.cmd

diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 000..3588df8
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,55 @@
+version: "{branch}-{build}"
+cache:
+- '%LOCALAPPDATA%\pip\Cache'
+build: off
+
+skip_tags: true
+
+shallow_clone: true
+clone_depth: 100
+
+environment:
+global:
+WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor\compiler.cmd'
+
+matrix:
+- TOXENV: 'py27-{noaccel,accel-win}'
+  TOXPYTHON: C:\Python27\python.exe
+  PYTHON_HOME: C:\Python27
+  PYTHON_VERSION: '2.7'
+  PYTHON_ARCH: '32'
+
+- TOXENV: 'py33-{noaccel,accel-win}'
+  TOXPYTHON: C:\Python33\python.exe
+  PYTHON_HOME: C:\Python33
+  PYTHON_VERSION: '3.3'
+  PYTHON_ARCH: '32'
+
+- TOXENV: 'py34-{noaccel,accel-win}'
+  TOXPYTHON: C:\Python34\python.exe
+  PYTHON_HOME: C:\Python34
+  PYTHON_VERSION: '3.4'
+  PYTHON_ARCH: '32'
+
+- TOXENV: 'py35-{noaccel,accel-win}'
+  TOXPYTHON: C:\Python35\python.exe
+  PYTHON_HOME: C:\Python35
+  PYTHON_VERSION: '3.5'
+  PYTHON_ARCH: '32'
+
+init:
+- ps: echo $env:TOXENV
+- ps: ls C:\Python*
+
+install:
+- '%TOXPYTHON% --version'
+- '%PYTHON_HOME%\Scripts\pip --version'
+- '%TOXPYTHON% -m pip install --egg tox'
+- '%PYTHON_HOME%\Scripts\tox --version'
+
+test_script:
+- '%WITH_COMPILER% %PYTHON_HOME%\Scripts\tox'
+
+on_failure:
+- ps: dir "env:"
+- ps: get-content .tox\*\log\*
diff --git a/ci/appveyor/compiler.cmd b/ci/appveyor/compiler.cmd
new file mode 100644
index 000..7f82a02
--- /dev/null
+++ b/ci/appveyor/compiler.cmd
@@ -0,0 +1,46 @@
+:: To build extensions for 64 bit Python 3, we need to configure environment
+:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
+::
+:: To build extensions for 64 bit Python 2, we need to configure environment
+:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
+::
+:: 32 bit builds do not require specific environment configurations.
+::
+:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
+:: cmd interpreter, at least for (SDK v7.0)
+::
+:: More details at:
+:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
+:: http://stackoverflow.com/a/13751649/163740
+::
+:: Author: Olivier Grisel
+:: License: CC0 1.0 Universal: 
http://creativecommons.org/publicdomain/zero/1.0/
+SET COMMAND_TO_RUN=%*
+SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
+SET WIN_WDK="c:\Program Files (x86)\Windows Kits\10\Include\wdf"
+ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH%
+
+
+IF "%PYTHON_VERSION%"=="3.5" (
+IF EXIST %WIN_WDK% (
+REM See: 
https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
+REN %WIN_WDK% 0wdf
+)
+GOTO main
+)
+
+IF "%PYTHON_ARCH%"=="32" (
+GOTO main
+)
+
+SET DISTUTILS_USE_SDK=1
+SET MSSdk=1
+"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q 
-version:%WINDOWS_SDK_VERSION%
+CALL "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
+
+:main
+
+ECHO Executing: %COMMAND_TO_RUN%
+CALL %COMMAND_TO_RUN% || EXIT 1
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 08/20] unittests: add utility context manager for changing directories

2016-06-01 Thread Dylan Baker
Using this context manager ensures that you change back to the original
directory when leaving the context manager

Signed-off-by: Dylan Baker 
---
 unittests/utils/nose.py | 16 
 1 file changed, 16 insertions(+)

diff --git a/unittests/utils/nose.py b/unittests/utils/nose.py
index 4298296..701b567 100644
--- a/unittests/utils/nose.py
+++ b/unittests/utils/nose.py
@@ -404,3 +404,19 @@ def capture_stderr(func):
 sys.stderr = restore
 
 return _inner
+
+
+@contextmanager
+def chdir(goto):
+"""chdir to a directory and back, guaranteed.
+
+This contextmanager ensures that after changing directory you cahgne back,
+using a try/finally block.
+
+"""
+returnto = getcwd()
+os.chdir(goto)
+try:
+yield
+finally:
+os.chdir(returnto)
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 01/20] travis: Add travis.yml for python code

2016-06-01 Thread Dylan Baker
For testing the framework with travis

Signed-off-by: Dylan Baker 
---
 .travis.yml | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000..8532d47
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,16 @@
+language: python
+python: 3.5
+cache: pip
+env:
+- TOX_ENV=py27-noaccel
+- TOX_ENV=py27-accel-nix
+- TOX_ENV=py33-noaccel
+- TOX_ENV=py33-accel-nix
+- TOX_ENV=py34-noaccel
+- TOX_ENV=py34-accel-nix
+- TOX_ENV=py35-noaccel
+- TOX_ENV=py35-accel-nix
+install:
+pip install tox
+script:
+- tox -e $TOX_ENV
-- 
2.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Fix the fnctl import on Windows

2016-06-01 Thread Dylan Baker
Quoting Brian Paul (2016-06-01 16:21:07)
> On 05/31/2016 02:45 PM, Dylan Baker wrote:
> > Quoting Olivier Berthier (2016-05-30 03:21:14)
> >> This patch disables the fnctl import on Windows.
> >> ---
> >>   framework/monitoring.py | 97 
> >> ++---
> >>   1 file changed, 52 insertions(+), 45 deletions(-)
> >>
> >> diff --git a/framework/monitoring.py b/framework/monitoring.py
> >> index f178bd6..9f7a0d1 100644
> >> --- a/framework/monitoring.py
> >> +++ b/framework/monitoring.py
> >> @@ -36,12 +36,17 @@ from __future__ import (
> >>   )
> >>   import abc
> >>   import errno
> >> -import fcntl
> >>   import os
> >>   import re
> >> +import sys
> >>
> >>   import six
> >>
> >> +try:
> >> +import fcntl
> >> +except:
> >> +pass
> >> +
> >>   from framework.core import PIGLIT_CONFIG
> >>   from framework.dmesg import LinuxDmesg
> >>   from framework import exceptions
> >> @@ -245,50 +250,52 @@ class MonitoringFile(BaseMonitoring):
> >>   This implements also a specific method for reading locked files.
> >>
> >>   """
> >> -
> >> -try:
> >> -with open(self._monitoring_source, 'r') as f:
> >> -lines = []
> >> -if self._is_locked:
> >> -# Create a duplicated file descriptor, this avoid lock
> >> -fd = os.dup(f.fileno())
> >> -# use I/O control for reading the lines
> >> -fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
> >> -
> >> -while True:
> >> -try:
> >> -line = os.read(fd, 1024)
> >> -if not line:
> >> -break;
> >> -except OSError as e:
> >> -if e.errno == errno.EAGAIN:
> >> -break
> >> -else:
> >> -raise e
> >> -lines.append(line.decode("utf-8", "strict"))
> >> -os.close(fd)
> >> -
> >> -else:
> >> -lines = f.read().splitlines()
> >> -
> >> -f.close()
> >> -
> >> -# Find all new entries, do this by slicing the list of 
> >> the lines to only
> >> -# returns elements after the last element stored. If 
> >> there are not
> >> -# matches a value error is raised, that means all of the 
> >> lines are new
> >> -l = 0
> >> -for index, item in enumerate(reversed(lines)):
> >> -if item == self._last_message:
> >> -l = len(lines) - index  # don't include the 
> >> matched element
> >> -break
> >> -self._new_messages = lines[l:]
> >> -# Attempt to store the last element of lines,
> >> -# unless there was no line
> >> -self._last_message = lines[-1] if lines else None
> >> -except Exception:
> >> -# if an error occured, we consider there are no new messages
> >> -self._new_messages = []
> >> -pass
> >> +if sys.platform.startswith('linux'):
> >> +try:
> >> +with open(self._monitoring_source, 'r') as f:
> >> +lines = []
> >> +if self._is_locked:
> >> +# Create a duplicated file descriptor, this avoid 
> >> lock
> >> +fd = os.dup(f.fileno())
> >> +# use I/O control for reading the lines
> >> +fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
> >> +
> >> +while True:
> >> +try:
> >> +line = os.read(fd, 1024)
> >> +if not line:
> >> +break;
> >> +except OSError as e:
> >> +if e.errno == errno.EAGAIN:
> >> +break
> >> +else:
> >> +raise e
> >> +lines.append(line.decode("utf-8", "strict"))
> >> +os.close(fd)
> >> +
> >> +else:
> >> +lines = f.read().splitlines()
> >> +
> >> +f.close()
> >> +
> >> +# Find all new entries, do this by slicing the list of
> >> +# the lines to only returns elements after the last 
> >> element
> >> +# stored. If there are not matches a value error is 
> >> raised,
> >> +# that means all of the lines are new
> >> +l = 0
> >> +for index, item in enumerate(reversed(lines)):
> >> + 

Re: [Piglit] [PATCH] Fix the fnctl import on Windows

2016-06-01 Thread Brian Paul

On 05/31/2016 02:45 PM, Dylan Baker wrote:

Quoting Olivier Berthier (2016-05-30 03:21:14)

This patch disables the fnctl import on Windows.
---
  framework/monitoring.py | 97 ++---
  1 file changed, 52 insertions(+), 45 deletions(-)

diff --git a/framework/monitoring.py b/framework/monitoring.py
index f178bd6..9f7a0d1 100644
--- a/framework/monitoring.py
+++ b/framework/monitoring.py
@@ -36,12 +36,17 @@ from __future__ import (
  )
  import abc
  import errno
-import fcntl
  import os
  import re
+import sys

  import six

+try:
+import fcntl
+except:
+pass
+
  from framework.core import PIGLIT_CONFIG
  from framework.dmesg import LinuxDmesg
  from framework import exceptions
@@ -245,50 +250,52 @@ class MonitoringFile(BaseMonitoring):
  This implements also a specific method for reading locked files.

  """
-
-try:
-with open(self._monitoring_source, 'r') as f:
-lines = []
-if self._is_locked:
-# Create a duplicated file descriptor, this avoid lock
-fd = os.dup(f.fileno())
-# use I/O control for reading the lines
-fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
-
-while True:
-try:
-line = os.read(fd, 1024)
-if not line:
-break;
-except OSError as e:
-if e.errno == errno.EAGAIN:
-break
-else:
-raise e
-lines.append(line.decode("utf-8", "strict"))
-os.close(fd)
-
-else:
-lines = f.read().splitlines()
-
-f.close()
-
-# Find all new entries, do this by slicing the list of the 
lines to only
-# returns elements after the last element stored. If there are 
not
-# matches a value error is raised, that means all of the lines 
are new
-l = 0
-for index, item in enumerate(reversed(lines)):
-if item == self._last_message:
-l = len(lines) - index  # don't include the matched 
element
-break
-self._new_messages = lines[l:]
-# Attempt to store the last element of lines,
-# unless there was no line
-self._last_message = lines[-1] if lines else None
-except Exception:
-# if an error occured, we consider there are no new messages
-self._new_messages = []
-pass
+if sys.platform.startswith('linux'):
+try:
+with open(self._monitoring_source, 'r') as f:
+lines = []
+if self._is_locked:
+# Create a duplicated file descriptor, this avoid lock
+fd = os.dup(f.fileno())
+# use I/O control for reading the lines
+fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
+
+while True:
+try:
+line = os.read(fd, 1024)
+if not line:
+break;
+except OSError as e:
+if e.errno == errno.EAGAIN:
+break
+else:
+raise e
+lines.append(line.decode("utf-8", "strict"))
+os.close(fd)
+
+else:
+lines = f.read().splitlines()
+
+f.close()
+
+# Find all new entries, do this by slicing the list of
+# the lines to only returns elements after the last element
+# stored. If there are not matches a value error is raised,
+# that means all of the lines are new
+l = 0
+for index, item in enumerate(reversed(lines)):
+if item == self._last_message:
+# don't include the matched element
+l = len(lines) - index
+break
+self._new_messages = lines[l:]
+# Attempt to store the last element of lines,
+# unless there was no line
+self._last_message = lines[-1] if lines else None
+except Exception:
+# if an error occured, we consider there are no new messages
+self._new_messages = []
+pass


  class 

Re: [Piglit] [PATCH] Fix the fnctl import on Windows

2016-06-01 Thread Dylan Baker
Quoting Olivier Berthier (2016-05-30 03:21:14)
[snip]
> +if sys.platform.startswith('linux'):
> +try:
> +with open(self._monitoring_source, 'r') as f:
> +lines = []
> +if self._is_locked:
> +# Create a duplicated file descriptor, this avoid 
> lock
> +fd = os.dup(f.fileno())
> +# use I/O control for reading the lines
> +fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
> +
> +while True:
> +try:
> +line = os.read(fd, 1024)
> +if not line:
> +break;
> +except OSError as e:
> +if e.errno == errno.EAGAIN:
> +break
> +else:
> +raise e
> +lines.append(line.decode("utf-8", "strict"))
> +os.close(fd)

I'm very confused here. What exactly is a locked file? Since on Linux at
least you can read a locked file as long as you have the proper
permissions I can't figure out what locking has to do with this code.
With the test you provided if I replace the whole of 'lines = []'
through 'f.close()' with 'lines = f.readlines()' the test passes, so
either the code here is bogus, the test is bogus, or both.

I think if we need to rely on POSIX-only modules then we need to guard
is_locked behind os.name == 'posix' or similar.

Dylan

> +
> +else:
> +lines = f.read().splitlines()
> +
> +f.close()
> +
> +# Find all new entries, do this by slicing the list of
> +# the lines to only returns elements after the last 
> element
> +# stored. If there are not matches a value error is 
> raised,
> +# that means all of the lines are new
> +l = 0
> +for index, item in enumerate(reversed(lines)):
> +if item == self._last_message:
> +# don't include the matched element
> +l = len(lines) - index
> +break
> +self._new_messages = lines[l:]
> +# Attempt to store the last element of lines,
> +# unless there was no line
> +self._last_message = lines[-1] if lines else None
> +except Exception:
> +# if an error occured, we consider there are no new messages
> +self._new_messages = []
> +pass


signature.asc
Description: signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Fix the fnctl import on Windows

2016-06-01 Thread Vinson Lee
On Tue, May 31, 2016 at 1:45 PM, Dylan Baker  wrote:
> Quoting Olivier Berthier (2016-05-30 03:21:14)
>> This patch disables the fnctl import on Windows.
>> ---
>>  framework/monitoring.py | 97 
>> ++---
>>  1 file changed, 52 insertions(+), 45 deletions(-)
>>
>> diff --git a/framework/monitoring.py b/framework/monitoring.py
>> index f178bd6..9f7a0d1 100644
>> --- a/framework/monitoring.py
>> +++ b/framework/monitoring.py
>> @@ -36,12 +36,17 @@ from __future__ import (
>>  )
>>  import abc
>>  import errno
>> -import fcntl
>>  import os
>>  import re
>> +import sys
>>
>>  import six
>>
>> +try:
>> +import fcntl
>> +except:
>> +pass
>> +
>>  from framework.core import PIGLIT_CONFIG
>>  from framework.dmesg import LinuxDmesg
>>  from framework import exceptions
>> @@ -245,50 +250,52 @@ class MonitoringFile(BaseMonitoring):
>>  This implements also a specific method for reading locked files.
>>
>>  """
>> -
>> -try:
>> -with open(self._monitoring_source, 'r') as f:
>> -lines = []
>> -if self._is_locked:
>> -# Create a duplicated file descriptor, this avoid lock
>> -fd = os.dup(f.fileno())
>> -# use I/O control for reading the lines
>> -fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
>> -
>> -while True:
>> -try:
>> -line = os.read(fd, 1024)
>> -if not line:
>> -break;
>> -except OSError as e:
>> -if e.errno == errno.EAGAIN:
>> -break
>> -else:
>> -raise e
>> -lines.append(line.decode("utf-8", "strict"))
>> -os.close(fd)
>> -
>> -else:
>> -lines = f.read().splitlines()
>> -
>> -f.close()
>> -
>> -# Find all new entries, do this by slicing the list of the 
>> lines to only
>> -# returns elements after the last element stored. If there 
>> are not
>> -# matches a value error is raised, that means all of the 
>> lines are new
>> -l = 0
>> -for index, item in enumerate(reversed(lines)):
>> -if item == self._last_message:
>> -l = len(lines) - index  # don't include the matched 
>> element
>> -break
>> -self._new_messages = lines[l:]
>> -# Attempt to store the last element of lines,
>> -# unless there was no line
>> -self._last_message = lines[-1] if lines else None
>> -except Exception:
>> -# if an error occured, we consider there are no new messages
>> -self._new_messages = []
>> -pass
>> +if sys.platform.startswith('linux'):
>> +try:
>> +with open(self._monitoring_source, 'r') as f:
>> +lines = []
>> +if self._is_locked:
>> +# Create a duplicated file descriptor, this avoid 
>> lock
>> +fd = os.dup(f.fileno())
>> +# use I/O control for reading the lines
>> +fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
>> +
>> +while True:
>> +try:
>> +line = os.read(fd, 1024)
>> +if not line:
>> +break;
>> +except OSError as e:
>> +if e.errno == errno.EAGAIN:
>> +break
>> +else:
>> +raise e
>> +lines.append(line.decode("utf-8", "strict"))
>> +os.close(fd)
>> +
>> +else:
>> +lines = f.read().splitlines()
>> +
>> +f.close()
>> +
>> +# Find all new entries, do this by slicing the list of
>> +# the lines to only returns elements after the last 
>> element
>> +# stored. If there are not matches a value error is 
>> raised,
>> +# that means all of the lines are new
>> +l = 0
>> +for index, item in enumerate(reversed(lines)):
>> +if item == self._last_message:
>> +# don't include the matched element
>> +l = len(lines) - index
>> +break
>> +self._new_messages = 

Re: [Piglit] [PATCH] Fix GetProgramPipelineiv test with GLSL 4.30+.

2016-06-01 Thread Dylan Baker
Quoting Kenneth Graunke (2016-05-31 18:39:01)
> The test was set up to use GLSL 4.30, 1.50, or 1.10, as available.
> 
> GLSL 4.20 removes the gl_FragColor variable, so the fragment shader
> would fail to compile if GLSL 4.30 was available.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96301
> Signed-off-by: Kenneth Graunke 
> Cc: mark.a.ja...@intel.com
> ---
>  tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c 
> b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
> index 1975180..2746e8b 100644
> --- a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
> +++ b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
> @@ -119,9 +119,14 @@ piglit_init(int argc, char **argv)
> "gl_Position = position;\n"
> "}\n";
> static const char fs_source[] =
> +   "#if __VERSION__ >= 430\n"

Even though the test runs with 430 shouldn't this be 420, since
gl_FragColor was removed in there, not 420?

> +   "layout(location = 0) out vec4 color;\n"
> +   "#else\n"
> +   "#define color gl_FragColor\n"
> +   "#endif\n"
> "void main()\n"
> "{\n"
> -   "gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);\n"
> +   "color = vec4(0.0, 1.0, 0.0, 0.0);\n"
> "}\n";
> static const char gs_source[] =
> "/* At least some versions of AMD's closed-source driver\n"
> -- 
> 2.8.3
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

Either way this seems reasonable,
Reviewed-by: Dylan Baker 


signature.asc
Description: signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.

2016-06-01 Thread Jordan Justen
On 2016-05-31 23:00:02, Ilia Mirkin wrote:
> On Wed, Jun 1, 2016 at 1:49 AM, Kenneth Graunke  wrote:
> > On Wednesday, June 1, 2016 1:34:42 AM PDT Ilia Mirkin wrote:
> >> Because strtol() truncates the the maximum value of "long", as does
> >> scanf apparently. This will make it impossible to test that a counter
> >> == -1 though, right?
> >
> > Yes, I suppose it would.  But you can always do == 4294967295 instead,
> > and that seems pretty reasonable (if a bit inconvenient) considering
> > the GLSL type is "atomic_uint"...
> 
> Fair enough. For ssbo I made it read 0xfoo for those. And there's already a
> 
> tests/spec/arb_compute_shader/execution/atomic-counter.shader_test:probe
> atomic counter 1 == 4294966784
> 

And another bug as well:

https://bugs.freedesktop.org/show_bug.cgi?id=96298

Reviewed-by: Jordan Justen 

> So what you're doing seems reasonable.
> 
> Reviewed-by: Ilia Mirkin 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.

2016-06-01 Thread Ilia Mirkin
On Wed, Jun 1, 2016 at 1:49 AM, Kenneth Graunke  wrote:
> On Wednesday, June 1, 2016 1:34:42 AM PDT Ilia Mirkin wrote:
>> Because strtol() truncates the the maximum value of "long", as does
>> scanf apparently. This will make it impossible to test that a counter
>> == -1 though, right?
>
> Yes, I suppose it would.  But you can always do == 4294967295 instead,
> and that seems pretty reasonable (if a bit inconvenient) considering
> the GLSL type is "atomic_uint"...

Fair enough. For ssbo I made it read 0xfoo for those. And there's already a

tests/spec/arb_compute_shader/execution/atomic-counter.shader_test:probe
atomic counter 1 == 4294966784

So what you're doing seems reasonable.

Reviewed-by: Ilia Mirkin 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit