unhidding --test-filter

This commit is contained in:
Miroslav Stampar 2012-06-14 14:36:53 +00:00
parent d2dd47fb23
commit 76584ff0fa
5 changed files with 12 additions and 8 deletions

View File

@ -139,8 +139,8 @@ def checkSqlInjection(place, parameter, value):
continue
# Skip tests if title is not included by the given filter
if conf.testFilter:
if not any(re.search(conf.testFilter, str(item), re.I) for item in [test.title, test.vector,\
if conf.tstF:
if not any(re.search(conf.tstF, str(item), re.I) for item in [test.title, test.vector,\
test.details.dbms if "details" in test and "dbms" in test.details else ""]):
debugMsg = "skipping test '%s' because " % title
debugMsg += "its name/vector/dbms is not included by the given filter"

View File

@ -1324,9 +1324,9 @@ def __cleanupOptions():
if conf.dbms:
conf.dbms = conf.dbms.capitalize()
if conf.testFilter:
if not any([char in conf.testFilter for char in ('.', ')', '(', ']', '[')]):
conf.testFilter = conf.testFilter.replace('*', '.*')
if conf.tstF:
if not any([char in conf.tstF for char in ('.', ')', '(', ']', '[')]):
conf.tstF = conf.tstF.replace('*', '.*')
if conf.timeSec not in kb.explicitSettings:
if conf.tor:

View File

@ -193,6 +193,7 @@ optDict = {
"mobile": "boolean",
"pageRank": "boolean",
"smart": "boolean",
"tstF": "string",
"wizard": "boolean",
"verbose": "integer"
},

View File

@ -619,6 +619,9 @@ def cmdLineParser():
action="store_true",
help="Conduct through tests only if positive heuristic(s)")
miscellaneous.add_option("--test-filter", dest="tstF",
help="Select tests by payloads and/or titles (e.g. ROW)")
miscellaneous.add_option("--wizard", dest="wizard",
action="store_true",
help="Simple wizard interface for beginner users")
@ -642,9 +645,6 @@ def cmdLineParser():
parser.add_option("--run-case", dest="runCase", type="int",
help=SUPPRESS_HELP)
parser.add_option("--test-filter", dest="testFilter",
help=SUPPRESS_HELP)
parser.add_option_group(target)
parser.add_option_group(request)
parser.add_option_group(optimization)

View File

@ -656,6 +656,9 @@ pageRank = False
# Valid: True or False
smart = False
# Select tests by payloads and/or titles (e.g. ROW)
tstF =
# Simple wizard interface for beginner users.
# Valid: True or False
wizard = False