diff options
author | Chad Versace <chad@chad-versace.us> | 2011-06-17 10:57:30 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2011-07-29 17:35:54 -0700 |
commit | 8762fc74edbc6a26de39a7507b935755e9feff5e (patch) | |
tree | babfc14cdc37156e662343312a47a69e3873c042 | |
parent | 6a6a549863d318fdd9b7d58e2c8f4ea03fb1766f (diff) |
piglit-run: Add option to enable/disable concurrent test runs
-c bool, --concurrent=bool Enable/disable concurrent test runs. Valid
option values are: 0, 1, on, off. (default: on)
CC: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r-- | framework/core.py | 3 | ||||
-rwxr-xr-x | piglit-run.py | 20 |
2 files changed, 20 insertions, 3 deletions
diff --git a/framework/core.py b/framework/core.py index 326b3d98..90aa4610 100644 --- a/framework/core.py +++ b/framework/core.py @@ -386,6 +386,7 @@ class TestrunResult: class Environment: def __init__(self): + self.concurrent = True self.execute = True self.filter = [] self.exclude_filter = [] @@ -436,7 +437,7 @@ class Test: assigned to ``testrun.tests[path]`` ''' args = (env, path, json_writer) - if self.runConcurrent: + if self.runConcurrent and env.concurrent: ConcurrentTestPool().put(self.__doRunWork, args=args) else: self.__doRunWork(*args) diff --git a/piglit-run.py b/piglit-run.py index 0771ede8..bbc38073 100755 --- a/piglit-run.py +++ b/piglit-run.py @@ -78,7 +78,8 @@ Options: -x regexp, --exclude-tests=regexp Excludey matching tests (can be used more than once) -n name, --name=name Name of the testrun - + -c bool, --concurrent=bool Enable/disable concurrent test runs. Valid + option values are: 0, 1, on, off. (default: on) Example: %(progName)s tests/all.tests results/all Run all tests, store the results in the directory results/all @@ -97,7 +98,15 @@ def main(): env = core.Environment() try: - options, args = getopt(sys.argv[1:], "hdt:n:x:", [ "help", "dry-run", "tests=", "name=", "exclude-tests=" ]) + option_list = [ + "help", + "dry-run", + "tests=", + "name=", + "exclude-tests=", + "concurrent=", + ] + options, args = getopt(sys.argv[1:], "hdt:n:x:c:", option_list) except GetoptError: usage() @@ -114,6 +123,13 @@ def main(): env.exclude_filter[:0] = [re.compile(value)] elif name in ('-n', '--name'): OptionName = value + elif name in ('-c, --concurrent'): + if value in ('1', 'on'): + env.concurrent = True + elif value in ('0', 'off'): + env.concurrent = False + else: + usage() if len(args) != 2: usage() |