OP2/PyOP2 — pull request #17 by kynan (2012-07-30 11:22:10+00:00)
Title: Unit test backend skip

Implement selecting and skipping of backends on a module/class basis.

Skipping backends on a per-test basis
=====================================

To skip a particular backend in a test case, pass the 'skip_'
parameter to the test function, where '' is any valid backend
string.

Skipping backends on a module or class basis
============================================

You can supply a list of backends to skip for all tests in a given
module or class with the ``skip_backends`` attribute in the module or
class scope:

# module test_foo.py

# All tests in this module will not run for the CUDA backend
skip_backends = ['cuda']

class TestFoo:
# All tests in this class will not run for the CUDA and OpenCL
# backends
skip_backends = ['opencl']

Selecting backends on a module or class basis
=============================================

Not passing the parameter 'backend' to a test case will cause it to
only run once for the backend that is currently initialized, which is
not always safe.

You can supply a list of backends for which to run all tests in a given
module or class with the ``backends`` attribute in the module or class
scope:

# module test_foo.py

# All tests in this module will only run for the CUDA and OpenCL
# backens
backends = ['cuda', 'opencl']

class TestFoo:
# All tests in this class will only run for the CUDA backend
backends = ['sequential', 'cuda']

This set of backends to run for will be further restricted by the
backends selected via command line parameters if applicable.