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