adding possibility to run only one live test (e.g. --run-case=8)

This commit is contained in:
Miroslav Stampar 2011-03-24 12:07:47 +00:00
parent 33c01726dd
commit e42cdfd138
2 changed files with 10 additions and 1 deletions

View File

@ -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:

View File

@ -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)