Esempio n. 1
0
def _populate_profile():
    profile = TestProfile()
    case_file = gen_caselist_txt(crucible_bin)
    with open(case_file, 'r') as caselist_file:
        for i, line in enumerate(caselist_file):
            case = line.rstrip()
            piglit_name = case.replace('.', grouptools.SEPARATOR)
            profile.test_list[piglit_name] = CrucibleTest(case)
Esempio n. 2
0
def make_profile(test_list, test_class):
    """Create a TestProfile instance."""
    profile = TestProfile()
    for testname in test_list:
        # deqp uses '.' as the testgroup separator.
        piglit_name = testname.replace('.', grouptools.SEPARATOR)
        profile.test_list[piglit_name] = test_class(testname)

    return profile
Esempio n. 3
0
def make_profile(test_list, test_class):
    """Create a TestProfile instance."""
    profile = TestProfile()
    for testname in test_list:
        # deqp uses '.' as the testgroup separator.
        piglit_name = testname.replace('.', grouptools.SEPARATOR)
        profile.test_list[piglit_name] = test_class(testname)

    return profile
Esempio n. 4
0
def _populate_profile():
    profile = TestProfile()
    case_file = gen_caselist_txt(crucible_bin)
    with open(case_file, 'r') as caselist_file:
        for i, line in enumerate(caselist_file):
            case = line.rstrip()
            piglit_name = case.replace('.', grouptools.SEPARATOR)
            profile.test_list[piglit_name] = CrucibleTest(case)
    os.remove('crucible.txt')
    return profile
Esempio n. 5
0
def _make_profile():
    """Create and populate a TestProfile instance."""
    profile_ = TestProfile()

    with tempfile.NamedTemporaryFile() as f:
        with open(os.devnull, "w") as d:
            subprocess.call([BIN, '-generateTestList', f.name],
                            stdout=d, stderr=d)

        f.seek(0)

        for l in f.readlines():
            try:
                category, test = l.split()
            except ValueError:
                continue

            group = grouptools.join('oglconform', category, test)
            profile_.test_list[group] = OGLCTest(category, test)

    return profile_
Esempio n. 6
0
def _make_profile():
    """Create and populate a TestProfile instance."""
    profile_ = TestProfile()

    with tempfile.NamedTemporaryFile() as f:
        with open(os.devnull, "w") as d:
            subprocess.call([BIN, '-generateTestList', f.name],
                            stdout=d, stderr=d)

        f.seek(0)

        for l in f.readlines():
            try:
                category, test = l.split()
            except ValueError:
                continue

            group = grouptools.join('oglconform', category, test)
            profile_.test_list[group] = OGLCTest(category, test)

    return profile_
Esempio n. 7
0
if 'IGT_TEST_ROOT' in os.environ:
    igtTestRoot = os.environ['IGT_TEST_ROOT']
else:
    igtTestRoot = os.path.join(framework.core.PIGLIT_CONFIG.get('igt', 'path'),
                               'tests')
    assert os.path.exists(igtTestRoot)

# check for the test lists
if not (os.path.exists(os.path.join(igtTestRoot, 'single-tests.txt'))
        and os.path.exists(os.path.join(igtTestRoot, 'multi-tests.txt'))):
    print "intel-gpu-tools test lists not found."
    sys.exit(0)

igtEnvironmentOk = checkEnvironment()

profile = TestProfile()

# This class is for timing out tests that hang. Create an instance by passing
# it a timeout in seconds and the Popen object that is running your test. Then
# call the start method (inherited from Thread) to start the timer. The Popen
# object is killed if the timeout is reached and it has not completed. Wait for
# the outcome by calling the join() method from the parent.


class ProcessTimeout(threading.Thread):
    def __init__(self, timeout, proc):
        threading.Thread.__init__(self)
        self.proc = proc
        self.timeout = timeout
        self.status = 0
Esempio n. 8
0
File: cl.py Progetto: krnowak/piglit
# __all__ to hide private names there will be a lot errors from pylint about
# invalid constant names, they're not really fixable, so just hide them.
# pylint: disable=invalid-name

from __future__ import division, absolute_import, print_function

import os

from framework.profile import TestProfile
from framework.test import PiglitCLTest
from framework import grouptools
from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR

__all__ = ['profile']

profile = TestProfile()

# Custom
with profile.group_manager(PiglitCLTest, 'custom') as g:
    g(['cl-custom-run-simple-kernel'], 'Run simple kernel')
    g(['cl-custom-flush-after-enqueue-kernel'], 'Flush after enqueue kernel')
    g(['cl-custom-r600-create-release-buffer-bug'],
      'r600 create release buffer bug')
    g(['cl-custom-buffer-flags'], 'Buffer flags')

with profile.group_manager(PiglitCLTest, 'api') as g:
    # Platform
    g(['cl-api-get-platform-ids'], 'clGetPlatformIDs')
    g(['cl-api-get-platform-info'], 'clGetPlatformInfo')

    # Device
Esempio n. 9
0
File: cl.py Progetto: groleo/piglit
# Helper functions

def add_plain_test(group, name, args):
        group[name] = PiglitTest(args)

def add_concurrent_test(group, name, args):
        test = PiglitTest(args)
        test.run_concurrent = true;
        group[name] = PiglitTest(args)

def add_plain_program_tester_test(group, name, path):
        add_plain_test(group, name, ['cl-program-tester', path])

######
# Collecting all tests
profile = TestProfile()

custom = {}
api = {}
program = {}
profile.tests['Custom'] = custom
profile.tests['API'] = api
profile.tests['Program'] = program

######
# Tests

# Custom
add_plain_test(custom, 'Run simple kernel', ['cl-custom-run-simple-kernel'])
add_plain_test(custom, 'Flush after enqueue kernel', ['cl-custom-flush-after-enqueue-kernel'])
add_plain_test(custom, 'r600 create release buffer bug', ['cl-custom-r600-create-release-buffer-bug'])
Esempio n. 10
0
#
# Testing the r300 DRI driver
#

from framework.profile import TestProfile
from framework.test import PiglitGLTest

__all__ = ['profile']

profile = TestProfile()

profile.tests['spec/!OpenGL 1.0/gl-1.0-blend-func'] = \
        PiglitGLTest('gl-1.0-blend-func', run_concurrent=True)
env = profile.tests['spec/!OpenGL 1.0/gl-1.0-blend-func'].env
#   R300 blending hardware appears to be bad
# Note that a setting of 1 bit is a special 
# case in Piglit that explicitly sets tolerance = 1.0f.
env['PIGLIT_BLEND_RGB_TOLERANCE'] = '2' # bits
env['PIGLIT_BLEND_ALPHA_TOLERANCE'] = '2' # bits
Esempio n. 11
0
#
# Minimal tests to check whether the installation is working
#

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

from framework import grouptools
from framework.profile import TestProfile
from framework.test import PiglitGLTest

__all__ = ['profile']

profile = TestProfile()

with profile.group_manager(PiglitGLTest,
                           grouptools.join('spec', '!OpenGL 1.0')) as g:
    g(['gl-1.0-readpixsanity'], run_concurrent=True)
Esempio n. 12
0
#
# Minimal tests to check whether the installation is working
#

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

from framework import grouptools
from framework.profile import TestProfile
from framework.test import PiglitGLTest

__all__ = ['profile']

profile = TestProfile()

with profile.group_manager(
        PiglitGLTest,
        grouptools.join('spec', '!OpenGL 1.0', 'gl-1.0-readpixsanity')) as g:
    g(['gl-1.0-readpixsanity'], run_concurrent=True)
Esempio n. 13
0
#
# Minimal tests to check whether the installation is working
#

from framework.profile import TestProfile
from framework.gleantest import GleanTest

__all__ = ['profile']

profile = TestProfile()
profile.tests['glean/basic'] = GleanTest('basic')
profile.tests['glean/readPixSanity'] = GleanTest('readPixSanity')
Esempio n. 14
0
    group[name] = PiglitTest(args)


def add_concurrent_test(group, name, args):
    test = PiglitTest(args)
    test.run_concurrent = true
    group[name] = PiglitTest(args)


def add_plain_program_tester_test(group, name, path):
    add_plain_test(group, name, ['cl-program-tester', path])


######
# Collecting all tests
profile = TestProfile()

custom = {}
api = {}
program = {}
profile.tests['Custom'] = custom
profile.tests['API'] = api
profile.tests['Program'] = program

######
# Tests

# Custom
add_plain_test(custom, 'Run simple kernel', ['cl-custom-run-simple-kernel'])
add_plain_test(custom, 'Flush after enqueue kernel',
               ['cl-custom-flush-after-enqueue-kernel'])
Esempio n. 15
0
)
import collections
import os

from six.moves import zip
import six

from framework.options import OPTIONS
from framework import grouptools
from framework.profile import TestProfile
from framework.test.shader_test import ShaderTest, MultiShaderTest
from .py_modules.constants import GENERATED_TESTS_DIR, TESTS_DIR

__all__ = ['profile']

profile = TestProfile()

shader_tests = collections.defaultdict(list)

# Find and add all shader tests.
basepath = os.path.normpath(os.path.join(TESTS_DIR, '..'))
gen_basepath = os.path.relpath(os.path.join(GENERATED_TESTS_DIR, '..'), basepath)

for basedir in [TESTS_DIR, GENERATED_TESTS_DIR]:
    isgenerated = basedir == GENERATED_TESTS_DIR
    for dirpath, _, filenames in os.walk(basedir):
        groupname = grouptools.from_path(os.path.relpath(dirpath, basedir))
        for filename in filenames:
            testname, ext = os.path.splitext(filename)
            if ext == '.shader_test':
                dirname = os.path.relpath(dirpath, basepath)
Esempio n. 16
0
File: cl.py Progetto: djdeath/piglit
# invalid constant names, they're not really fixable, so just hide them.
# pylint: disable=invalid-name

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

import os

from framework.profile import TestProfile
from framework.test import PiglitCLTest
from framework import grouptools
from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR

__all__ = ['profile']

profile = TestProfile()

# Custom
with profile.group_manager(PiglitCLTest, 'custom') as g:
    g(['cl-custom-run-simple-kernel'], 'Run simple kernel')
    g(['cl-custom-flush-after-enqueue-kernel'], 'Flush after enqueue kernel')
    g(['cl-custom-r600-create-release-buffer-bug'],
      'r600 create release buffer bug')
    g(['cl-custom-buffer-flags'], 'Buffer flags')

with profile.group_manager(PiglitCLTest, 'api') as g:
    # Platform
    g(['cl-api-get-platform-ids'], 'clGetPlatformIDs')
    g(['cl-api-get-platform-info'], 'clGetPlatformInfo')

    # Device
Esempio n. 17
0
# __all__ to hide private names there will be a lot errors from pylint about
# invalid constant names, they're not really fixable, so just hide them.
# pylint: disable=invalid-name

from __future__ import division, absolute_import, print_function

import os

from framework.profile import TestProfile
from framework.test import PiglitCLTest
from framework import grouptools
from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR

__all__ = ["profile"]

profile = TestProfile()

# Custom
with profile.group_manager(PiglitCLTest, "custom") as g:
    g(["cl-custom-run-simple-kernel"], "Run simple kernel")
    g(["cl-custom-flush-after-enqueue-kernel"], "Flush after enqueue kernel")
    g(["cl-custom-r600-create-release-buffer-bug"], "r600 create release buffer bug")
    g(["cl-custom-buffer-flags"], "Buffer flags")

with profile.group_manager(PiglitCLTest, "api") as g:
    # Platform
    g(["cl-api-get-platform-ids"], "clGetPlatformIDs")
    g(["cl-api-get-platform-info"], "clGetPlatformInfo")

    # Device
    g(["cl-api-get-device-ids"], "clGetDeviceIDs")
Esempio n. 18
0
# -*- coding: utf-8 -*-

import itertools

from tests.quick_gl import profile as _profile1
from tests.quick_shader import profile as _profile2
from framework.test import PiglitGLTest
from framework.test.shader_test import ShaderTest, MultiShaderTest
from framework.profile import TestProfile

__all__ = ['profile']

# Save the filters from the original profiles to a new profile
profile = TestProfile()
profile.filters = _profile1.filters + _profile2.filters

# Add a modified version of each PiglitGLTest as a khr_no_error variant.
# Shader runner doesn't explitly test for expected errors so we add shader
# tests as is. We actively filter GLSL parser and any other type of tests.
for name, test in itertools.chain(_profile1.test_list.items(),
                                  _profile2.test_list.items()):
    if isinstance(test, (PiglitGLTest, ShaderTest, MultiShaderTest)):
        profile.test_list['{} khr_no_error'.format(name)] = test
        test.command += ['-khr_no_error']
Esempio n. 19
0
# -*- coding: utf-8 -*-
"""All Vulkan tests that come with piglit, using default settings."""

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

import os

from framework.profile import TestProfile
from framework import grouptools
from framework.test.piglit_test import VkRunnerTest
from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR

__all__ = ['profile']

profile = TestProfile()

# Find and add all shader tests.
for basedir in [TESTS_DIR, GENERATED_TESTS_DIR]:
    _basedir = os.path.join(basedir, 'vulkan')
    for dirpath, _, filenames in os.walk(_basedir):
        groupname = grouptools.from_path(os.path.relpath(dirpath, _basedir))
        groupname = grouptools.join('vulkan', groupname)
        dirname = os.path.relpath(dirpath, os.path.join(basedir, '..'))
        for filename in filenames:
            testname, ext = os.path.splitext(filename)
            if ext != '.vk_shader_test':
                continue
            test = VkRunnerTest(os.path.join(dirname, filename))
            group = grouptools.join(groupname, testname)
            assert group not in profile.test_list, group
Esempio n. 20
0
#
# Minimal tests to check whether the installation is working
#

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

from framework import grouptools
from framework.profile import TestProfile
from framework.test import PiglitGLTest

__all__ = ['profile']

profile = TestProfile()

with profile.group_manager(
        PiglitGLTest,
        grouptools.join('spec', '!OpenGL 1.0', 'gl-1.0-readpixsanity')) as g:
    g(['gl-1.0-readpixsanity'], run_concurrent=True)
Esempio n. 21
0
if 'IGT_TEST_ROOT' in os.environ:
    igtTestRoot = os.environ['IGT_TEST_ROOT']
else:
    igtTestRoot = os.path.join(framework.core.PIGLIT_CONFIG.get('igt', 'path'),
                               'tests')
    assert os.path.exists(igtTestRoot)

# check for the test lists
if not (os.path.exists(os.path.join(igtTestRoot, 'single-tests.txt'))
        and os.path.exists(os.path.join(igtTestRoot, 'multi-tests.txt'))):
    print "intel-gpu-tools test lists not found."
    sys.exit(0)

igtEnvironmentOk = checkEnvironment()

profile = TestProfile()

class IGTTest(Test):
    def __init__(self, binary, arguments=None):
        if arguments is None:
            arguments = []
        super(IGTTest, self).__init__(
            [path.join(igtTestRoot, binary)] + arguments)
        self.timeout = 600

    def interpret_result(self):
        if not igtEnvironmentOk:
            return

        if self.result['returncode'] == 0:
            self.result['result'] = 'pass'
Esempio n. 22
0
                        unicode_literals)
import collections
import os

from six.moves import zip
import six

from framework.options import OPTIONS
from framework import grouptools
from framework.profile import TestProfile
from framework.test.shader_test import ShaderTest, MultiShaderTest
from .py_modules.constants import GENERATED_TESTS_DIR, TESTS_DIR

__all__ = ['profile']

profile = TestProfile()

shader_tests = collections.defaultdict(list)

# Find and add all shader tests.
basepath = os.path.normpath(os.path.join(TESTS_DIR, '..'))
gen_basepath = os.path.relpath(os.path.join(GENERATED_TESTS_DIR, '..'),
                               basepath)

for basedir in [TESTS_DIR, GENERATED_TESTS_DIR]:
    isgenerated = basedir == GENERATED_TESTS_DIR
    for dirpath, _, filenames in os.walk(basedir):
        groupname = grouptools.from_path(os.path.relpath(dirpath, basedir))
        for filename in filenames:
            testname, ext = os.path.splitext(filename)
            if ext == '.shader_test':
Esempio n. 23
0
"""A profile that runs only GLSLParserTest instances."""

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

from framework import grouptools
from framework.profile import TestProfile
from framework.test.glsl_parser_test import GLSLParserTest, GLSLParserNoConfigError
from framework.test.piglit_test import ASMParserTest, ROOT_DIR
from .py_modules.constants import GENERATED_TESTS_DIR, TESTS_DIR

__all__ = ['profile']

profile = TestProfile()

# Find and add all shader tests.
basepath = os.path.normpath(os.path.join(TESTS_DIR, '..'))
gen_basepath = os.path.relpath(os.path.join(GENERATED_TESTS_DIR, '..'), basepath)

for basedir in [TESTS_DIR, GENERATED_TESTS_DIR]:
    isgenerated = basedir == GENERATED_TESTS_DIR
    for dirpath, _, filenames in os.walk(basedir):
        groupname = grouptools.from_path(os.path.relpath(dirpath, basedir))
        for filename in filenames:
            testname, ext = os.path.splitext(filename)
            if ext in ['.vert', '.tesc', '.tese', '.geom', '.frag', '.comp']:
                dirname = os.path.relpath(dirpath, basepath)
                filepath = os.path.join(dirname, filename)
                if isgenerated:
Esempio n. 24
0
# -*- coding: utf-8 -*-

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

import six

from tests.quick_gl import profile as _profile1
from tests.quick_shader import profile as _profile2
from framework.test import PiglitGLTest
from framework.test.shader_test import ShaderTest, MultiShaderTest
from framework.profile import TestProfile

__all__ = ['profile']

# Save the filters from the original profiles to a new profile
profile = TestProfile()
profile.filters = _profile1.filters + _profile2.filters

# Add a modified version of each PiglitGLTest as a khr_no_error variant.
# Shader runner doesn't explitly test for expected errors so we add shader
# tests as is. We actively filter GLSL parser and any other type of tests.
for name, test in itertools.chain(six.iteritems(_profile1.test_list),
                                  six.iteritems(_profile2.test_list)):
    if isinstance(test, (PiglitGLTest, ShaderTest, MultiShaderTest)):
        profile.test_list['{} khr_no_error'.format(name)] = test
        test.command += ['-khr_no_error']