summaryrefslogtreecommitdiff
path: root/piglit-run.py
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2014-01-20 18:01:24 -0800
committerTom Stellard <thomas.stellard@amd.com>2014-01-23 08:10:54 -0800
commit06b9217485ce1d3375c525fdfbfbd48bc0cc379b (patch)
treeca458285178a906967a0af86f771d5f44466eeb8 /piglit-run.py
parent3a05f362034bdf3b65cf7ca52ca6ff6c7c7f2502 (diff)
framework/core.py: Add a config parser
The config parser will read options from a file called piglit.conf in the root of piglit's source directory or from a file specified by the -f option to piglit-run.py Tom Stellard: - Added command-line option Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Diffstat (limited to 'piglit-run.py')
-rwxr-xr-xpiglit-run.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/piglit-run.py b/piglit-run.py
index cf19073dc..f9cca0490 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -31,6 +31,7 @@ import traceback
sys.path.append(path.dirname(path.realpath(sys.argv[0])))
import framework.core as core
+from framework.core import PIGLIT_CONFIG
from framework.threads import synchronized_self
@@ -72,6 +73,11 @@ def main():
parser.add_argument("-p", "--platform",
choices=["glx", "x11_egl", "wayland", "gbm"],
help="Name of windows system passed to waffle")
+ parser.add_argument("-f", "--config",
+ dest="config_file",
+ type=argparse.FileType("r"),
+ help="Optionally specify a piglit config file to use. "
+ "Default is piglit.conf")
parser.add_argument("--valgrind",
action="store_true",
help="Run tests in valgrind's memcheck")
@@ -93,6 +99,13 @@ def main():
if args.platform:
os.environ['PIGLIT_PLATFORM'] = args.platform
+ # Read the config file
+ if args.config_file:
+ PIGLIT_CONFIG.readfp(args.config_file)
+ args.config_file.close()
+ else:
+ PIGLIT_CONFIG.read(os.path.join(os.path.dirname(__file__), 'piglit.conf'))
+
# Pass arguments into Environment
env = core.Environment(concurrent=args.concurrency,
exclude_filter=args.exclude_tests,