diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2012-11-25 12:29:57 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2012-11-25 12:29:57 -0800 |
commit | c143236645b39c3d5589ce949645333079d5454c (patch) | |
tree | 7521af4b755935707a1df1b7a83d62f7f05189aa | |
parent | a8eccba6a92f4e227a12ec04c88cf9682fe04565 (diff) |
rc file work: set defaults, override with cli arguments
-rw-r--r-- | framework/config.py | 10 | ||||
-rwxr-xr-x | programs/run.py | 19 | ||||
-rw-r--r-- | robynrc.example | 6 |
3 files changed, 27 insertions, 8 deletions
diff --git a/framework/config.py b/framework/config.py index c56e308..f0bd1a4 100644 --- a/framework/config.py +++ b/framework/config.py @@ -22,14 +22,22 @@ # import sys import os.path as path -from configparser import ConfigParser import xdg.BaseDirectory as xdg +from configparser import ConfigParser +from multiprocessing import cpu_count __all__ = ['load'] def load(): config = ConfigParser() + # Set default values + config.read_dict({'options': { + 'platform': 'glx', + 'threads': 5 + }}) + + # Read the robynrc file rcdir = xdg.load_first_config('robyn') if rcdir: rcfile = path.join(xdg.load_first_config('robyn'), 'robynrc') diff --git a/programs/run.py b/programs/run.py index d435cbe..59d6aef 100755 --- a/programs/run.py +++ b/programs/run.py @@ -34,7 +34,7 @@ import sys import framework.database import suites -def parseArguments(argv): +def parseArguments(argv, config): p = ArgumentParser(prog='robyn run', description='A GPU test runner') p.add_argument('-d', '--dry-run', action='store_true', help='Do not actually run tests, but show what would be performed', @@ -47,8 +47,10 @@ def parseArguments(argv): help='Exclude matching tests (regular expression)') p.add_argument('-c', '--threads', action='store', type=int, metavar='<thread count>', - help='Number of tests to run concurrently', - default=cpu_count()) + help='Number of tests to run concurrently') + p.add_argument('-p', '--platform', action='store', + metavar='(glx|x11_egl|wayland|agl|wgl)', + help='Window system platform (as recognized by Waffle)') p.add_argument('--valgrind', action='store_true', help="Run tests in Valgrind's memcheck tool.", default=False) @@ -56,10 +58,17 @@ def parseArguments(argv): metavar='<results database>', help='Specify an alternate result database (defaults to ~/.local/share/robyn/results.db))') p.add_argument('suites', nargs='+') - return p.parse_args(argv) + + options = p.parse_args(argv) + + # Override config file settings with the command line options. + rc_options = ['threads', 'results'] + config.read_dict({'options': dict((k, v) for k, v in vars(options).items() if k in rc_options and v is not None)}) + + return options def main(argv, config): - options = parseArguments(argv) + options = parseArguments(argv, config) framework.database.load() tests = suites.loadTestLists(config, options.suites) diff --git a/robynrc.example b/robynrc.example index 9e1b7a1..708e3f4 100644 --- a/robynrc.example +++ b/robynrc.example @@ -11,9 +11,11 @@ basedir = /home/kwg/Projects/gles3conform/GTF_ES/glsl/GTF binary = /home/kwg/Projects/oglconform/dump/linux/debug64/OGLconform/oglconform64 [options] -platform = glx # x11_egl, wayland, agl, wgl +# Platform (as recognized by waffle). Options: glx, x11_egl, wayland, agl, wgl +platform = glx -threads = 1 # No concurrency +# Maximum number of threads (set to 1 to disable concurrency) +threads = 1 # Detect intermittent tests recheck-fail = 5 |