コード例 #1
0
ファイル: test_gleantest.py プロジェクト: techtonik/piglit
def test_crash():
    """test.gleantest.GleanTest.interpret_result: Crashes are set to crash"""
    test = GleanTest('foo')
    test.result.returncode = -5
    test.interpret_result()

    assert test.result.result is status.CRASH
コード例 #2
0
ファイル: gleantest_tests.py プロジェクト: rib/piglit
def test_crash():
    """test.gleantest.GleanTest.interpret_result: Crashes are set to crash"""
    test = GleanTest('foo')
    test.result.returncode = -5
    test.interpret_result()

    nt.eq_(test.result.result, 'crash')
コード例 #3
0
def test_crash():
    """test.gleantest.GleanTest.interpret_result: Crashes are set to crash"""
    test = GleanTest('foo')
    test.result.returncode = -5
    test.interpret_result()

    assert test.result.result is status.CRASH
コード例 #4
0
ファイル: gleantest_tests.py プロジェクト: Endle/piglit-gsoc
def test_crash():
    """test.gleantest.GleanTest.interpret_result: Crashes are set to crash"""
    test = GleanTest('foo')
    test.result.returncode = -5
    test.interpret_result()

    nt.eq_(test.result.result, 'crash')
コード例 #5
0
ファイル: test_gleantest.py プロジェクト: techtonik/piglit
def test_is_skip_glx(mocker):
    """test.gleantest.GleanTest.is_skip: Does not skip when platform is glx."""
    opts = mocker.patch('framework.test.gleantest.options.OPTIONS',
                        new_callable=Options)
    opts.env['PIGLIT_PLATFORM'] = 'glx'

    test = GleanTest('foo')
    test.is_skip()
コード例 #6
0
def test_is_skip_glx(mocker):
    """test.gleantest.GleanTest.is_skip: Does not skip when platform is glx."""
    opts = mocker.patch('framework.test.gleantest.options.OPTIONS',
                        new_callable=Options)
    opts.env['PIGLIT_PLATFORM'] = 'glx'

    test = GleanTest('foo')
    test.is_skip()
コード例 #7
0
def test_is_skip_not_glx(mocker):
    """test.gleantest.GleanTest.is_skip: Skips when platform isn't glx."""
    opts = mocker.patch('framework.test.gleantest.options.OPTIONS',
                        new_callable=Options)
    opts.env['PIGLIT_PLATFORM'] = 'gbm'

    test = GleanTest('foo')
    with pytest.raises(_TestIsSkip):
        test.is_skip()
コード例 #8
0
ファイル: test_gleantest.py プロジェクト: techtonik/piglit
def test_is_skip_not_glx(mocker):
    """test.gleantest.GleanTest.is_skip: Skips when platform isn't glx."""
    opts = mocker.patch('framework.test.gleantest.options.OPTIONS',
                        new_callable=Options)
    opts.env['PIGLIT_PLATFORM'] = 'gbm'

    test = GleanTest('foo')
    with pytest.raises(_TestIsSkip):
        test.is_skip()
コード例 #9
0
ファイル: test_gleantest.py プロジェクト: techtonik/piglit
def test_bad_returncode():
    """test.gleantest.GleanTest: If returncode is 0 the result is 'fail'.

    Currently glean returns 127 if piglit can't find it's libs (LD_LIBRARY_PATH
    isn't set properly), and then marks such tests as pass, when they obviously
    are not.

    """
    test = GleanTest('basic')
    test.result.returncode = 1
    test.interpret_result()
    assert test.result.result == 'fail'
コード例 #10
0
ファイル: gleantest_tests.py プロジェクト: krnowak/piglit
def test_bad_returncode():
    """test.gleantest.GleanTest: If returncode is 0 the result is 'fail'

    Currently clean returns 127 if piglit can't find it's libs (LD_LIBRARY_PATH
    isn't set properly), and then marks such tests as pass, when they obviously
    are not.

    """
    test = GleanTest('basic')
    test.result['returncode'] = 1
    test.interpret_result()
    nt.assert_equal(test.result['result'], 'fail')
コード例 #11
0
def test_bad_returncode():
    """ Result is 'Fail' when returncode is not 0

    Currently clean returns 127 if piglit can't find it's libs (LD_LIBRARY_PATH
    isn't set properly), and then marks such tests as pass, when they obviously
    are not.

    """
    test = GleanTest('basic')
    test.result['returncode'] = 1
    test.interpret_result()
    assert test.result['result'] == 'fail', "Result should have been fail"
コード例 #12
0
ファイル: gleantest_tests.py プロジェクト: djkurtz/piglit
def test_bad_returncode():
    """ Result is 'Fail' when returncode is not 0

    Currently clean returns 127 if piglit can't find it's libs (LD_LIBRARY_PATH
    isn't set properly), and then marks such tests as pass, when they obviously
    are not.

    """
    test = GleanTest('basic')
    test.result['returncode'] = 1
    test.interpret_result()
    assert test.result['result'] == 'fail', "Result should have been fail"
コード例 #13
0
ファイル: test_gleantest.py プロジェクト: techtonik/piglit
def test_global_params_setter():
    """Values from self.GLOBAL_ARGS are not pushed into self._command by a
    setter.
    """
    test = GleanTest('basic')
    GleanTest.GLOBAL_PARAMS = ['--quick']
    test.command += '-foo'
    assert '--quick' not in test._command
コード例 #14
0
def test_GLOBAL_PARAMS_assignment():
    """ Test to ensure that GleanTest.GLOBAL_PARAMS are correctly assigned

    Specifically this tests for a bug where GLOBAL_PARAMS only affected
    instances of GleanTest created after GLOBAL_PARAMS were set, so changing the
    GLOBAL_PARAMS value had unexpected results.

    If this test passes the GleanTest.command attributes will be the same in
    the instance created before the GLOBAL_PARAMS assignment and the one created
    after. A failure means the that GLOBAL_PARAMS are not being added to tests
    initialized before it is set.

    """
    test1 = GleanTest('basic')
    GleanTest.GLOBAL_PARAMS = ['--quick']
    test2 = GleanTest('basic')
    assert test1.command == test2.command
コード例 #15
0
ファイル: gleantest_tests.py プロジェクト: krnowak/piglit
def test_is_skip_glx_egl():
    """test.gleantest.GleanTest.is_skip: Does not skip when platform is mixed_glx_egl
    """
    GleanTest.OPTS.env['PIGLIT_PLATFORM'] = 'mixed_glx_egl'
    test = GleanTest('foo')
    test.is_skip()
コード例 #16
0
ファイル: gleantest_tests.py プロジェクト: krnowak/piglit
def test_is_skip_not_glx():
    """test.gleantest.GleanTest.is_skip: Skips when platform isn't glx"""
    GleanTest.OPTS.env['PIGLIT_PLATFORM'] = 'gbm'
    test = GleanTest('foo')
    test.is_skip()
コード例 #17
0
ファイル: gleantest_tests.py プロジェクト: krnowak/piglit
def test_is_skip_glx():
    """test.gleantest.GleanTest.is_skip: Does not skip when platform is glx"""
    GleanTest.OPTS.env['PIGLIT_PLATFORM'] = 'glx'
    test = GleanTest('foo')
    test.is_skip()
コード例 #18
0
ファイル: gleantest_tests.py プロジェクト: Endle/piglit-gsoc
def test_is_skip_glx(mock_opts):
    """test.gleantest.GleanTest.is_skip: Does not skip when platform is glx"""
    mock_opts.env['PIGLIT_PLATFORM'] = 'glx'
    test = GleanTest('foo')
    test.is_skip()
コード例 #19
0
ファイル: gleantest_tests.py プロジェクト: Endle/piglit-gsoc
def test_initialize_gleantest():
    """test.gleantest.GleanTest: class initializes correctly"""
    GleanTest('name')
コード例 #20
0
def test_initialize_gleantest():
    """ Test that GleanTest initilizes """
    test = GleanTest('name')
    assert test
コード例 #21
0
ファイル: gleantest_tests.py プロジェクト: Endle/piglit-gsoc
def test_is_skip_not_glx(mock_opts):
    """test.gleantest.GleanTest.is_skip: Skips when platform isn't glx"""
    mock_opts.env['PIGLIT_PLATFORM'] = 'gbm'
    test = GleanTest('foo')
    test.is_skip()
コード例 #22
0
ファイル: gleantest_tests.py プロジェクト: Endle/piglit-gsoc
def test_is_skip_glx_egl(mock_opts):
    """test.gleantest.GleanTest.is_skip: Does not skip when platform is mixed_glx_egl
    """
    mock_opts.env['PIGLIT_PLATFORM'] = 'mixed_glx_egl'
    test = GleanTest('foo')
    test.is_skip()