示例#1
0
    def test_get_option_required(self, mocker):
        """deqp.get_option: dies if a required option cannot be retrieved."""
        mocker.patch('framework.test.deqp.os.environ', {}, True)

        with pytest.raises(exceptions.PiglitFatalError):
            deqp.get_option('NOT_REAL', ('fake', 'fake'), default='',
                            required=True)
示例#2
0
    def test_get_option_required(self, mocker):
        """deqp.get_option: dies if a required option cannot be retrieved."""
        mocker.patch('framework.test.deqp.os.environ', {}, True)

        with pytest.raises(exceptions.PiglitFatalError):
            deqp.get_option('NOT_REAL', ('fake', 'fake'), default='',
                            required=True)
示例#3
0
def _deprecated_get(env_, conf_, dep_env=None, dep_conf=('', ''), **kwargs):
    """Attempt to get deprecated values, then modern vaules.

    If a deprecated value is found give the user a warning, this uses
    deqp_get_option internally for both the deprecated and undeprecated paths,
    but prefers the old version and issues a warning if they are encountered.
    The old version is looked up unconditionally, if it is not found then the
    new version will be looked up unconditionally, with the default and
    requires keywords (which the first will not have).
    """
    val = None
    if dep_env is not None and dep_conf is not None:
        val = deqp.get_option(dep_env, dep_conf)

        if dep_env is not None and os.environ.get(dep_env) is not None:
            # see if the old environment variable was set, if it is uses it,
            # and give a deprecation warning
            warnings.warn(
                '{} has been replaced by {} and will be removed. You should '
                'update any scripts using the old environment variable'.format(
                    dep_env, env_))
        elif dep_conf != ('', '') and PIGLIT_CONFIG.has_option(*dep_conf):
            warnings.warn(
                '{} has been replaced by {} and will be removed. You should '
                'update any scripts using the old conf variable'.format(
                    ':'.join(dep_conf), ':'.join(conf_)))

    return val if val is not None else deqp.get_option(env_, conf_, **kwargs)
示例#4
0
def _deprecated_get(env_, conf_, dep_env=None, dep_conf=('', ''), **kwargs):
    """Attempt to get deprecated values, then modern vaules.

    If a deprecated value is found give the user a warning, this uses
    deqp_get_option internally for both the deprecated and undeprecated paths,
    but prefers the old version and issues a warning if they are encountered.
    The old version is looked up unconditionally, if it is not found then the
    new version will be looked up unconditionally, with the default and
    requires keywords (which the first will not have).
    """
    val = None
    if dep_env is not None and dep_conf is not None:
        val = deqp.get_option(dep_env, dep_conf)

        if dep_env is not None and os.environ.get(dep_env) is not None:
            # see if the old environment variable was set, if it is uses it,
            # and give a deprecation warning
            warnings.warn(
                '{} has been replaced by {} and will be removed. You should '
                'update any scripts using the old environment variable'.format(
                    dep_env, env_))
        elif dep_conf != ('', '') and PIGLIT_CONFIG.has_option(*dep_conf):
            warnings.warn(
                '{} has been replaced by {} and will be removed. You should '
                'update any scripts using the old conf variable'.format(
                    ':'.join(dep_conf), ':'.join(conf_)))

    return val if val is not None else deqp.get_option(env_, conf_, **kwargs)
示例#5
0
    def test_from_default(self):
        """deqp.get_option: if env is set it overrides piglit.conf."""
        # The mock means that only the first value matters
        actual = deqp.get_option('foo', ('foo', 'foo'),
                                 default=mock.sentinel.good)

        assert actual is mock.sentinel.good
示例#6
0
    def test_from_default(self):
        """deqp.get_option: if env is set it overrides piglit.conf."""
        # The mock means that only the first value matters
        actual = deqp.get_option('foo', ('foo', 'foo'),
                                 default=mock.sentinel.good)

        assert actual is mock.sentinel.good
示例#7
0
    def test_from_env(self, env, conf):
        """deqp.get_option: if env is set it overrides piglit.conf."""
        conf.return_value = mock.sentinel.bad
        env['TEST'] = mock.sentinel.good

        # The mock means that only the first value matters
        actual = deqp.get_option('TEST', ('foo', 'foo'))

        assert actual is mock.sentinel.good
示例#8
0
    def test_from_env(self, env, conf):
        """deqp.get_option: if env is set it overrides piglit.conf."""
        conf.return_value = mock.sentinel.bad
        env['TEST'] = mock.sentinel.good

        # The mock means that only the first value matters
        actual = deqp.get_option('TEST', ('foo', 'foo'))

        assert actual is mock.sentinel.good
示例#9
0
    def test_from_conf(self, conf):
        """deqp.get_option: if env is not set a value is taken from
        piglit.conf.
        """
        conf.return_value = mock.sentinel

        # The mock means that these values don't actually matter
        actual = deqp.get_option('foo', ('foo', 'foo'))

        assert actual is mock.sentinel
示例#10
0
    def test_from_conf(self, conf):
        """deqp.get_option: if env is not set a value is taken from
        piglit.conf.
        """
        conf.return_value = mock.sentinel

        # The mock means that these values don't actually matter
        actual = deqp.get_option('foo', ('foo', 'foo'))

        assert actual is mock.sentinel
示例#11
0
文件: khr_gl.py 项目: fabe3k/piglit
one could set:
PIGLIT_KHR_GL_BIN -- environment equivalent of [khr_gl]:bin
PIGLIT_KHR_GL_EXTRA_ARGS -- environment equivalent of [khr_gl]:extra_args

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import itertools

from framework.test import deqp

__all__ = ['profile']

_KHR_BIN = deqp.get_option('PIGLIT_KHR_GL_BIN', ('khr_gl', 'bin'),
                           required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_KHR_GL_EXTRA_ARGS', ('khr_gl', 'extra_args'),
                              default='').split()


class DEQPKHRTest(deqp.DEQPBaseTest):
    deqp_bin = _KHR_BIN

    @property
    def extra_args(self):
        return super(DEQPKHRTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]

# Add all of the suites by default, users can use filters to remove them.
profile = deqp.make_profile(  # pylint: disable=invalid-name
def test_get_option_conf_no_option():
    """deqp.get_option: if a no_option error is raised and env is unset None is return
    """
    nt.eq_(
        deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'not_exists')), None)
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')
示例#14
0
Alternatively (or in addition, since environment variables have precedence),
one could set:
PIGLIT_KHR_GL_BIN -- environment equivalent of [khr_gl45]:bin
PIGLIT_KHR_GL_EXTRA_ARGS -- environment equivalent of [khr_gl45]:extra_args

"""

import itertools

from framework.test import deqp
from framework.options import OPTIONS

__all__ = ['profile']

_KHR_BIN = deqp.get_option('PIGLIT_KHR_GL_BIN', ('khr_gl45', 'bin'),
                           required=True)

_KHR_MUSTPASS = deqp.get_option('PIGLIT_KHRGL45_MUSTPASS',
                                 ('khr_gl45', 'mustpasslist'),
                                 required=OPTIONS.deqp_mustpass)

_EXTRA_ARGS = deqp.get_option('PIGLIT_KHR_GL_EXTRA_ARGS', ('khr_gl45', 'extra_args'),
                              default='').split()


class DEQPKHRTest(deqp.DEQPBaseTest):
    deqp_bin = _KHR_BIN

    @property
    def extra_args(self):
        return super(DEQPKHRTest, self).extra_args + \
示例#15
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Piglit integrations for dEQP GLES31 tests."""

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

from framework.test import deqp
from framework.options import OPTIONS

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_GLES31_BIN = deqp.get_option('PIGLIT_DEQP_GLES31_BIN',
                                   ('deqp-gles31', 'bin'),
                                   required=True)

_DEQP_MUSTPASS = deqp.get_option('PIGLIT_DEQP31_MUSTPASS',
                                 ('deqp-gles31', 'mustpasslist'),
                                 required=OPTIONS.deqp_mustpass)

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES31_EXTRA_ARGS',
                              ('deqp-gles31', 'extra_args'),
                              default='').split()


class DEQPGLES31Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES31_BIN

    @property
示例#16
0
def test_get_option_conf_no_option():
    """deqp.get_option: if a no_option error is raised and env is unset None is return
    """
    nt.eq_(deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'not_exists')),
           None)
示例#17
0
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Piglit integrations for dEQP GLES2 tests."""

from framework.test import deqp

__all__ = ["profile"]

# Path to the deqp-gles2 executable.
_DEQP_GLES2_BIN = deqp.get_option("PIGLIT_DEQP_GLES2_BIN", ("deqp-gles2", "bin"))

_EXTRA_ARGS = deqp.get_option("PIGLIT_DEQP_GLES2_EXTRA_ARGS", ("deqp-gles2", "extra_args"), default="").split()


class DEQPGLES2Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES2_BIN
    extra_args = [x for x in _EXTRA_ARGS if not x.startswith("--deqp-case")]


profile = deqp.make_profile(  # pylint: disable=invalid-name
    deqp.iter_deqp_test_cases(deqp.gen_caselist_txt(_DEQP_GLES2_BIN, "dEQP-GLES2-cases.txt", _EXTRA_ARGS)),
    DEQPGLES2Test,
)
示例#18
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Piglit integrations for dEQP EGL tests."""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)

from framework.test import deqp

__all__ = ['profile']

_EGL_BIN = deqp.get_option('PIGLIT_DEQP_EGL_BIN',
                           ('deqp-egl', 'bin'),
                           required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_EGL_EXTRA_ARGS',
                              ('deqp-egl', 'extra_args'),
                              default='').split()


class DEQPEGLTest(deqp.DEQPBaseTest):
    deqp_bin = _EGL_BIN

    @property
    def extra_args(self):
        return super(DEQPEGLTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
示例#19
0
one could set:
PIGLIT_CTS_GLES_BIN -- environment equivalent of [cts_gles]:bin
PIGLIT_CTS_GLES_EXTRA_ARGS -- environment equivalent of [cts_gles]:extra_args

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import itertools

from framework.test import deqp

__all__ = ['profile']

_CTS_BIN = deqp.get_option('PIGLIT_CTS_GLES_BIN', ('cts_gles', 'bin'),
                           required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_GLES_EXTRA_ARGS', ('cts_gles', 'extra_args'),
                              default='').split()


class DEQPCTSTest(deqp.DEQPBaseTest):
    deqp_bin = _CTS_BIN

    @property
    def extra_args(self):
        return super(DEQPCTSTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]


# Add all of the suites by default, users can use filters to remove them.
示例#20
0
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Piglit integrations for dEQP GLES3 tests."""

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_GLES3_BIN = deqp.get_option('PIGLIT_DEQP_GLES3_BIN',
                                  ('ogles3conform', 'bin'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES3_EXTRA_ARGS',
                              ('ogles3conform', 'extra_args'),
                              default='').split()


class DEQPGLES3Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES3_BIN
    extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]


profile = deqp.make_profile(  # pylint: disable=invalid-name
    deqp.iter_deqp_test_cases(
        deqp.gen_caselist_txt(_DEQP_GLES3_BIN, 'ES3-CTS-cases.txt',
                              _EXTRA_ARGS)),
示例#21
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Piglit integrations for dEQP GLES3 tests."""

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import xml.etree.cElementTree as ET

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_GLES3_EXE = deqp.get_option('PIGLIT_DEQP_GLES3_EXE',
                                  ('deqp-gles3', 'exe'))

# Path to the xml file which contained the case list of the subset of dEQP
# and marked as must pass in CTS.
_DEQP_MUSTPASS = deqp.get_option('PIGLIT_DEQP_MUSTPASS',
                                 ('deqp-gles3', 'mustpasslist'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES3_EXTRA_ARGS',
                              ('deqp-gles3', 'extra_args'),
                              default='').split()


def _get_test_case(root, root_group, outputfile):
    """Parser the test case list of Google Android CTS,
    and store the test case list to dEQP-GLES3-cases.txt
    """
示例#22
0
PIGLIT_KHR_GL_BIN -- environment equivalent of [khr_gl45]:bin
PIGLIT_KHR_GL_EXTRA_ARGS -- environment equivalent of [khr_gl45]:extra_args

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import itertools

from framework.test import deqp
from framework.options import OPTIONS

__all__ = ['profile']

_KHR_BIN = deqp.get_option('PIGLIT_KHR_GL_BIN', ('khr_gl45', 'bin'),
                           required=True)

_KHR_MUSTPASS = deqp.get_option('PIGLIT_KHRGL45_MUSTPASS',
                                 ('khr_gl45', 'mustpasslist'),
                                 required=OPTIONS.deqp_mustpass)

_EXTRA_ARGS = deqp.get_option('PIGLIT_KHR_GL_EXTRA_ARGS', ('khr_gl45', 'extra_args'),
                              default='').split()


class DEQPKHRTest(deqp.DEQPBaseTest):
    deqp_bin = _KHR_BIN

    @property
    def extra_args(self):
        return super(DEQPKHRTest, self).extra_args + \
示例#23
0
    return val if val is not None else deqp.get_option(env_, conf_, **kwargs)


_DEQP_GLES3_BIN = _deprecated_get('PIGLIT_DEQP_GLES3_BIN',
                                  ('deqp-gles3', 'bin'),
                                  required=True,
                                  dep_env='PIGLIT_DEQP_GLES3_EXE',
                                  dep_conf=('deqp-gles3', 'exe'))

_DEQP_MUSTPASS = _deprecated_get('PIGLIT_DEQP3_MUSTPASS',
                                 ('deqp-gles3', 'mustpasslist'),
                                 dep_env='PIGLIT_DEQP_MUSTPASS',
                                 required=OPTIONS.deqp_mustpass)

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES3_EXTRA_ARGS',
                              ('deqp-gles3', 'extra_args'),
                              default='').split()


class DEQPGLES3Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES3_BIN

    @property
    def extra_args(self):
        return super(DEQPGLES3Test, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]


profile = deqp.make_profile(  # pylint: disable=invalid-name
    deqp.select_source(_DEQP_GLES3_BIN, 'dEQP-GLES3-cases.txt', _DEQP_MUSTPASS,
                       _EXTRA_ARGS), DEQPGLES3Test)
示例#24
0
def test_get_option_conf_no_section():
    """deqp.get_option: if a no_section error is raised and env is unset None is return
    """
    assert not PIGLIT_CONFIG.has_section('deqp_test')
    nt.eq_(deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'test_env')), None)
示例#25
0
Alternatively (or in addition, since environment variables have
precedence), one could set:
PIGLIT_KHR_NOCTX_BIN -- environment equivalent of [khr_noctx]:bin
PIGLIT_KHR_NOCTX_EXTRA_ARGS -- environment equivalent of
[khr_noctx]:extra_args

"""

import itertools

from framework.test import deqp

__all__ = ['profile']

_KHR_BIN = deqp.get_option('PIGLIT_KHR_NOCTX_BIN', ('khr_noctx', 'bin'),
                           required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_KHR_NOCTX_EXTRA_ARGS',
                              ('khr_noctx', 'extra_args'),
                              default='').split()


class DEQPKHRTest(deqp.DEQPBaseTest):
    deqp_bin = _KHR_BIN

    @property
    def extra_args(self):
        return super(DEQPKHRTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]

示例#26
0
# SOFTWARE.

"""Piglit integrations for dEQP GLES2 tests."""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)

from framework.test import deqp
from framework.options import OPTIONS

__all__ = ['profile']

# Path to the deqp-gles2 executable.
_DEQP_GLES2_BIN = deqp.get_option('PIGLIT_DEQP_GLES2_BIN',
                                  ('deqp-gles2', 'bin'),
                                  required=True)

_DEQP_MUSTPASS = deqp.get_option('PIGLIT_DEQP2_MUSTPASS',
                                 ('deqp-gles2', 'mustpasslist'),
                                 required=OPTIONS.deqp_mustpass)

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES2_EXTRA_ARGS',
                              ('deqp-gles2', 'extra_args'),
                              default='').split()


class DEQPGLES2Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES2_BIN

    @property
示例#27
0
文件: cts.py 项目: Endle/piglit-gsoc
one could set:
PIGLIT_CTS_BIN -- environment equivalent of [cts]:bin
PIGLIT_CTS_EXTRA_ARGS -- environment equivalent of [cts]:extra_args

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import itertools

from framework.test import deqp

__all__ = ['profile']

_CTS_BIN = deqp.get_option('PIGLIT_CTS_BIN', ('cts', 'bin'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_EXTRA_ARGS', ('cts', 'extra_args'),
                              default='').split()


class DEQPCTSTest(deqp.DEQPBaseTest):
    deqp_bin = _CTS_BIN
    extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]


# Add all of the suites by default, users can use filters to remove them.
profile = deqp.make_profile(  # pylint: disable=invalid-name
    itertools.chain(
        deqp.iter_deqp_test_cases(
            deqp.gen_caselist_txt(_CTS_BIN, 'ES2-CTS-cases.txt', _EXTRA_ARGS)),
示例#28
0
# SOFTWARE.

"""Piglit integrations for dEQP GLES3 tests."""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)

import xml.etree.cElementTree as ET

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_GLES3_EXE = deqp.get_option('PIGLIT_DEQP_GLES3_EXE',
                                  ('deqp-gles3', 'exe'))

# Path to the xml file which contained the case list of the subset of dEQP
# and marked as must pass in CTS.
_DEQP_MUSTPASS = deqp.get_option('PIGLIT_DEQP_MUSTPASS',
                                 ('deqp-gles3', 'mustpasslist'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES3_EXTRA_ARGS',
                              ('deqp-gles3', 'extra_args'),
                              default='').split()


def _get_test_case(root, root_group, outputfile):
    """Parser the test case list of Google Android CTS,
    and store the test case list to dEQP-GLES3-cases.txt
    """
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')),
        'from env')
示例#30
0
Alternatively (or in addition, since environment variables have precedence),
one could set:
PIGLIT_CTS_BIN -- environment equivalent of [cts]:bin
PIGLIT_CTS_EXTRA_ARGS -- environment equivalent of [cts]:extra_args

"""

from __future__ import absolute_import, division, print_function
import itertools

from framework.test import deqp

__all__ = ["profile"]

_CTS_BIN = deqp.get_option("PIGLIT_CTS_BIN", ("cts", "bin"))

_EXTRA_ARGS = deqp.get_option("PIGLIT_CTS_EXTRA_ARGS", ("cts", "extra_args"), default="").split()


class DEQPCTSTest(deqp.DEQPBaseTest):
    deqp_bin = _CTS_BIN
    extra_args = [x for x in _EXTRA_ARGS if not x.startswith("--deqp-case")]


# Add all of the suites by default, users can use filters to remove them.
profile = deqp.make_profile(  # pylint: disable=invalid-name
    itertools.chain(
        deqp.iter_deqp_test_cases(deqp.gen_caselist_txt(_CTS_BIN, "ES2-CTS-cases.txt", _EXTRA_ARGS)),
        deqp.iter_deqp_test_cases(deqp.gen_caselist_txt(_CTS_BIN, "ES3-CTS-cases.txt", _EXTRA_ARGS)),
        deqp.iter_deqp_test_cases(deqp.gen_caselist_txt(_CTS_BIN, "ES31-CTS-cases.txt", _EXTRA_ARGS)),
def test_get_option_default():
    """deqp.get_option: default value is returned when env and conf are unset
    """
    nt.eq_(
        deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'test_env'),
                        'foobar'), 'foobar')
示例#32
0
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Piglit integrations for dEQP GLES31 tests."""

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_GLES31_BIN = deqp.get_option('PIGLIT_DEQP_GLES31_BIN',
                                   ('deqp-gles31', 'bin'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES31_EXTRA_ARGS',
                              ('deqp-gles31', 'extra_args'),
                              default='').split()


class DEQPGLES31Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES31_BIN
    extra_args = [x for x in _EXTRA_ARGS if not x.startsiwth('--deqp-case')]


profile = deqp.make_profile(  # pylint: disable=invalid-name
    deqp.iter_deqp_test_cases(
        deqp.gen_caselist_txt(_DEQP_GLES31_BIN, 'dEQP-GLES31-cases.txt',
                              _EXTRA_ARGS)),
示例#33
0
upstream: https://github.com/KhronosGroup/Vulkan-CTS

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import re

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_VK_BIN = deqp.get_option('PIGLIT_DEQP_VK_BIN',
                               ('deqp-vk', 'bin'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_VK_EXTRA_ARGS',
                              ('deqp-vk', 'extra_args'),
                              default='').split()

_DEQP_ASSERT = re.compile(
    r'deqp-vk: external/vulkancts/.*: Assertion `.*\' failed.')


class DEQPVKTest(deqp.DEQPBaseTest):
    """Test representation for Khronos Vulkan CTS."""
    timeout = 60
    deqp_bin = _DEQP_VK_BIN
    @property
    def extra_args(self):
示例#34
0
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')
示例#35
0
def test_get_option_default():
    """deqp.get_option: default value is returned when env and conf are unset
    """
    nt.eq_(
        deqp.get_option('_PIGLIT_TEST_ENV', ('deqp_test', 'test_env'),
                        'foobar'), 'foobar')
示例#36
0
upstream: https://github.com/KhronosGroup/Vulkan-CTS

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import re

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles3 executable.
_DEQP_VK_BIN = deqp.get_option('PIGLIT_DEQP_VK_BIN',
                               ('deqp-vk', 'bin'),
                               required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_VK_EXTRA_ARGS',
                              ('deqp-vk', 'extra_args'),
                              default='').split()

_DEQP_ASSERT = re.compile(
    r'deqp-vk: external/vulkancts/.*: Assertion `.*\' failed.')


class DEQPVKTest(deqp.DEQPBaseTest):
    """Test representation for Khronos Vulkan CTS."""
    timeout = 60
    deqp_bin = _DEQP_VK_BIN
    @property
示例#37
0
    return val if val is not None else deqp.get_option(env_, conf_, **kwargs)


_DEQP_GLES3_BIN = _deprecated_get('PIGLIT_DEQP_GLES3_BIN',
                                  ('deqp-gles3', 'bin'),
                                  required=True,
                                  dep_env='PIGLIT_DEQP_GLES3_EXE',
                                  dep_conf=('deqp-gles3', 'exe'))

_DEQP_MUSTPASS = _deprecated_get('PIGLIT_DEQP3_MUSTPASS',
                                 ('deqp-gles3', 'mustpasslist'),
                                 dep_env='PIGLIT_DEQP_MUSTPASS',
                                 required=OPTIONS.deqp_mustpass)

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES3_EXTRA_ARGS',
                              ('deqp-gles3', 'extra_args'),
                              default='').split()


class DEQPGLES3Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES3_BIN

    @property
    def extra_args(self):
        return super(DEQPGLES3Test, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]


profile = deqp.make_profile(  # pylint: disable=invalid-name
    deqp.select_source(_DEQP_GLES3_BIN, 'dEQP-GLES3-cases.txt', _DEQP_MUSTPASS,
                       _EXTRA_ARGS),
示例#38
0
文件: cts_gl.py 项目: rib/piglit
one could set:
PIGLIT_CTS_GL_BIN -- environment equivalent of [cts_gl]:bin
PIGLIT_CTS_GL_EXTRA_ARGS -- environment equivalent of [cts_gl]:extra_args

"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import itertools

from framework.test import deqp

__all__ = ['profile']

_CTS_BIN = deqp.get_option('PIGLIT_CTS_GL_BIN', ('cts_gl', 'bin'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_GL_EXTRA_ARGS', ('cts_gl', 'extra_args'),
                              default='').split()


class DEQPCTSTest(deqp.DEQPBaseTest):
    deqp_bin = _CTS_BIN

    @property
    def extra_args(self):
        return super(DEQPCTSTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]

# Add all of the suites by default, users can use filters to remove them.
profile = deqp.make_profile(  # pylint: disable=invalid-name
示例#39
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Piglit integrations for dEQP GLES2 tests."""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)

from framework.test import deqp

__all__ = ['profile']

# Path to the deqp-gles2 executable.
_DEQP_GLES2_BIN = deqp.get_option('PIGLIT_DEQP_GLES2_BIN',
                                  ('deqp-gles2', 'bin'))

_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES2_EXTRA_ARGS',
                              ('deqp-gles2', 'extra_args'),
                              default='').split()


class DEQPGLES2Test(deqp.DEQPBaseTest):
    deqp_bin = _DEQP_GLES2_BIN
    extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]


profile = deqp.make_profile(  # pylint: disable=invalid-name
    deqp.iter_deqp_test_cases(
        deqp.gen_caselist_txt(_DEQP_GLES2_BIN, 'dEQP-GLES2-cases.txt',
                              _EXTRA_ARGS)),
示例#40
0
[cts_gl]:extra_args -- any extra arguments to be passed to cts (optional)

Alternatively (or in addition, since environment variables have precedence),
one could set:
PIGLIT_CTS_GL_BIN -- environment equivalent of [cts_gl]:bin
PIGLIT_CTS_GL_EXTRA_ARGS -- environment equivalent of [cts_gl]:extra_args

"""

import itertools

from framework.test import deqp

__all__ = ['profile']

_CTS_BIN = deqp.get_option('PIGLIT_CTS_GL_BIN', ('cts_gl', 'bin'),
                           required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_GL_EXTRA_ARGS',
                              ('cts_gl', 'extra_args'),
                              default='').split()


class DEQPCTSTest(deqp.DEQPBaseTest):
    deqp_bin = _CTS_BIN

    @property
    def extra_args(self):
        return super(DEQPCTSTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]

示例#41
0
precedence), one could set:
PIGLIT_GTF_GLES_BIN -- environment equivalent of [gtf_gles]:bin
PIGLIT_GTF_GLES_EXTRA_ARGS -- environment equivalent of
[gtf_gles]:extra_args

"""

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
import itertools

from framework.test import deqp

__all__ = ['profile']

_GTF_BIN = deqp.get_option('PIGLIT_GTF_GLES_BIN', ('gtf_gles', 'bin'),
                           required=True)

_EXTRA_ARGS = deqp.get_option('PIGLIT_GTF_GLES_EXTRA_ARGS',
                              ('gtf_gles', 'extra_args'),
                              default='').split()


class DEQPGTFTest(deqp.DEQPBaseTest):
    deqp_bin = _GTF_BIN

    @property
    def extra_args(self):
        return super(DEQPGTFTest, self).extra_args + \
            [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]

示例#42
0
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')),
           'from env')