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