From e42cdfd138ca6f5c22606efb31d272dfaf31fc39 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 24 Mar 2011 12:07:47 +0000 Subject: [PATCH] adding possibility to run only one live test (e.g. --run-case=8) --- lib/core/testing.py | 8 +++++++- lib/parse/cmdline.py | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/core/testing.py b/lib/core/testing.py index 75b1ab2b7..75bf41903 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -119,6 +119,11 @@ def liveTest(): vars_[child.tagName] = child.getAttribute("value") for case in livetests.getElementsByTagName("case"): + count += 1 + + if conf.runCase and conf.runCase != count: + continue + name = None log = [] session = [] @@ -143,7 +148,6 @@ def liveTest(): if item.hasAttribute("value"): session.append(replaceVars(item.getAttribute("value"), vars_)) - count += 1 msg = "running live test case '%s' (%d/%d)" % (name, count, length) logger.info(msg) result = runCase(switches, log, session) @@ -214,6 +218,8 @@ def runCase(switches=None, log=None, session=None): for item in log: if item.startswith("r'") and item.endswith("'"): if not re.search(item[2:-1], content, re.DOTALL): + import pdb + pdb.set_trace() retVal = False break elif content.find(item) < 0: diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 160710ca4..56417792b 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -520,6 +520,9 @@ def cmdLineParser(): parser.add_option("--real-test", dest="realTest", action="store_true", default=False, help=SUPPRESS_HELP) + parser.add_option("--run-case", dest="runCase", type="int", + default=None, help=SUPPRESS_HELP) + parser.add_option("--technique", dest="technique", type="int", default=0, help=SUPPRESS_HELP)