2 # Copyright (c) 2015-2016 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 """Stores global piglit options.
24 This is as close to a true global function as python gets. The only deal here
25 is that while you can mutate
29 from __future__
import (
30 absolute_import
, division
, print_function
, unicode_literals
38 # pylint: disable=too-few-public-methods
41 class _Options(object): # pylint: disable=too-many-instance-attributes
42 """Contains all options for a piglit run.
44 This is used as a sort of global state object, kinda like piglit.conf. This
45 big difference here is that this object is largely generated internally,
46 and is controlled mostly through command line options rather than through
47 the configuration file.
49 Options are as follows:
50 execute -- False for dry run
51 valgrind -- True if valgrind is to be used
52 env -- environment variables set for each test before run
53 deqp_mustpass -- True to enable the use of the deqp mustpass list feature.
60 self
.deqp_mustpass
= False
61 self
.process_isolation
= True
63 self
.force_glsl
= False
65 # env is used to set some base environment variables that are not going
66 # to change across runs, without sending them to os.environ which is
67 # fickle and easy to break
72 os
.path
.abspath(os
.path
.join(os
.path
.dirname(__file__
),
77 """Reinitialize all values to defaults."""
81 for key
, values
in six
.iteritems(self
.__dict
__):
82 if not key
.startswith('_'):