示例#1
0
def get_mode():
    """Return the key value of the correct compressor to use.

    Try the environment variable PIGLIT_COMPRESSION; then check the
    PIGLIT_CONFIG section 'core', option 'compression'; finally fall back to
    DEFAULT.

    This will raise an UnsupportedCompressionError if there isn't a compressor
    for that mode. It is the job of the caller to handle this exceptions

    """
    # This is provided as a function rather than a constant because as a
    # function it can honor changes to the PIGLIT_CONFIG instance, or the
    # PIGLIT_COMPRESSION environment variable.

    method = (os.environ.get('PIGLIT_COMPRESSION')
              or PIGLIT_CONFIG.safe_get('core', 'compression') or DEFAULT)

    if method not in COMPRESSORS:
        raise UnsupportedCompressor(method)

    return method
示例#2
0
def get_mode():
    """Return the key value of the correct compressor to use.

    Try the environment variable PIGLIT_COMPRESSION; then check the
    PIGLIT_CONFIG section 'core', option 'compression'; finally fall back to
    DEFAULT.

    This will raise an UnsupportedCompressionError if there isn't a compressor
    for that mode. It is the job of the caller to handle this exceptions

    """
    # This is provided as a function rather than a constant because as a
    # function it can honor changes to the PIGLIT_CONFIG instance, or the
    # PIGLIT_COMPRESSION environment variable.

    method = (os.environ.get('PIGLIT_COMPRESSION') or
              PIGLIT_CONFIG.safe_get('core', 'compression') or
              DEFAULT)

    if method not in COMPRESSORS:
        raise UnsupportedCompressor(method)

    return method
示例#3
0
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
import os
import six
import subprocess

from framework import grouptools, backends, exceptions
from framework.core import PIGLIT_CONFIG
from framework.profile import TestProfile, Test

__all__ = ['profile']

crucible_bin = os.environ.get('PIGLIT_CRUCIBLE_BIN', None)
if crucible_bin is None:
    crucible_bin = PIGLIT_CONFIG.safe_get(('crucible', 'bin'), True)

if crucible_bin is None:
    raise exceptions.PiglitFatalError(
        'Cannot get "PIGLIT_CRUCIBLE_BIN" or conf value "crucible:bin"')


class CrucibleTest(Test):
    """Test representation for Crucible"""
    def __init__(self, case_name):
        command = [crucible_bin, 'run', '--junit-xml=crucible.xml', case_name]
        self._case = case_name
        super(CrucibleTest, self).__init__(command)

    def interpret_result(self):
        test = backends.junit.REGISTRY.load('crucible.xml', 'none')
示例#4
0
from __future__ import (
    absolute_import, division, print_function, unicode_literals
)
import os
import six
import subprocess

from framework import grouptools, backends, exceptions
from framework.core import PIGLIT_CONFIG
from framework.profile import TestProfile, Test

__all__ = ['profile']

crucible_bin = os.environ.get('PIGLIT_CRUCIBLE_BIN', None)
if crucible_bin is None:
    crucible_bin = PIGLIT_CONFIG.safe_get(('crucible', 'bin'), True)

if crucible_bin is None:
    raise exceptions.PiglitFatalError(
        'Cannot get "PIGLIT_CRUCIBLE_BIN" or conf value "crucible:bin"')


class CrucibleTest(Test):
    """Test representation for Crucible"""
    def __init__(self, case_name):
        command = [crucible_bin, 'run', '--junit-xml=crucible.xml', case_name]
        self._case = case_name
        super(CrucibleTest, self).__init__(command)

    def interpret_result(self):
        test = backends.junit.REGISTRY.load('crucible.xml', 'none')
示例#5
0
 def __init__(self, state, state_lock):
     super(HTTPLogServer, self).__init__()
     port = int(PIGLIT_CONFIG.safe_get("http", "port", fallback=8080))
     self._httpd = HTTPServer(("", port), HTTPLogServer.RequestHandler)
     self._httpd.state = state
     self._httpd.state_lock = state_lock
示例#6
0
文件: log.py 项目: chadversary/piglit
 def __init__(self, state, state_lock):
     super(HTTPLogServer, self).__init__()
     port = int(PIGLIT_CONFIG.safe_get("http", "port", fallback=8080))
     self._httpd = HTTPServer(("", port), HTTPLogServer.RequestHandler)
     self._httpd.state = state
     self._httpd.state_lock = state_lock