1 # Copyright 2014, 2015 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 """Piglit integrations for dEQP GLES3 tests."""
23 from __future__
import (
24 absolute_import
, division
, print_function
, unicode_literals
29 from framework
.core
import PIGLIT_CONFIG
30 from framework
.test
import deqp
31 from framework
.options
import OPTIONS
36 def _deprecated_get(env_
, conf_
, dep_env
=None, dep_conf
=('', ''), **kwargs
):
37 """Attempt to get deprecated values, then modern vaules.
39 If a deprecated value is found give the user a warning, this uses
40 deqp_get_option internally for both the deprecated and undeprecated paths,
41 but prefers the old version and issues a warning if they are encountered.
42 The old version is looked up unconditionally, if it is not found then the
43 new version will be looked up unconditionally, with the default and
44 requires keywords (which the first will not have).
47 if dep_env
is not None and dep_conf
is not None:
48 val
= deqp
.get_option(dep_env
, dep_conf
)
50 if dep_env
is not None and os
.environ
.get(dep_env
) is not None:
51 # see if the old environment variable was set, if it is uses it,
52 # and give a deprecation warning
54 '{} has been replaced by {} and will be removed. You should '
55 'update any scripts using the old environment variable'.format(
57 elif dep_conf
!= ('', '') and PIGLIT_CONFIG
.has_option(*dep_conf
):
59 '{} has been replaced by {} and will be removed. You should '
60 'update any scripts using the old conf variable'.format(
61 ':'.join(dep_conf
), ':'.join(conf_
)))
63 return val
if val
is not None else deqp
.get_option(env_
, conf_
, **kwargs
)
66 _DEQP_GLES3_BIN
= _deprecated_get('PIGLIT_DEQP_GLES3_BIN',
67 ('deqp-gles3', 'bin'),
69 dep_env
='PIGLIT_DEQP_GLES3_EXE',
70 dep_conf
=('deqp-gles3', 'exe'))
72 _DEQP_MUSTPASS
= _deprecated_get('PIGLIT_DEQP3_MUSTPASS',
73 ('deqp-gles3', 'mustpasslist'),
74 dep_env
='PIGLIT_DEQP_MUSTPASS',
75 required
=OPTIONS
.deqp_mustpass
)
77 _EXTRA_ARGS
= deqp
.get_option('PIGLIT_DEQP_GLES3_EXTRA_ARGS',
78 ('deqp-gles3', 'extra_args'),
82 class DEQPGLES3Test(deqp
.DEQPBaseTest
):
83 deqp_bin
= _DEQP_GLES3_BIN
87 return super(DEQPGLES3Test
, self
).extra_args
+ \
88 [x
for x
in _EXTRA_ARGS
if not x
.startswith('--deqp-case')]
91 profile
= deqp
.make_profile( # pylint: disable=invalid-name
92 deqp
.select_source(_DEQP_GLES3_BIN
, 'dEQP-GLES3-cases.txt', _DEQP_MUSTPASS
,