summaryrefslogtreecommitdiffstats
path: root/tools/coverage/coverage.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/coverage/coverage.py')
-rwxr-xr-xtools/coverage/coverage.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/coverage/coverage.py b/tools/coverage/coverage.py
index 8c18bc7..6879460 100755
--- a/tools/coverage/coverage.py
+++ b/tools/coverage/coverage.py
@@ -720,6 +720,14 @@ class ParsePFWlog():
MATCH = "match"
ACTION = "action"
+ class ChangeRequestOnUnknownCriterion(CustomError):
+ def __init__(self, criterion):
+ self.criterion = criterion
+
+ def __str__(self):
+ return ("Change request on an unknown criterion %s." %
+ self.criterion)
+
def __init__(self, domains, criteria, ErrorsToIgnore=()):
self.domains = domains;
@@ -802,7 +810,10 @@ class ParsePFWlog():
path = [criterionName]
changeCriterionOperation = lambda criterion : criterion.changeState(newCriterionState)
- self.criteria.operationOnChild(path, changeCriterionOperation)
+ try:
+ self.criteria.operationOnChild(path, changeCriterionOperation)
+ except ChildNotFoundError:
+ raise self.ChangeRequestOnUnknownCriterion(criterionName)
def _configApplication(self, matchConfig):
# Unpack
@@ -968,6 +979,13 @@ class ArgumentParser:
)
myArgParser.add_argument(
+ '--ignore-unknown-criterion',
+ dest="unknwonCriterionFlag",
+ action='store_true',
+ help="ignore unknown criterion"
+ )
+
+ myArgParser.add_argument(
'--ignore-incoherent-criterion-state',
dest="incoherentCriterionFlag",
action='store_true',
@@ -1003,6 +1021,9 @@ class ArgumentParser:
errorToIgnore.append(Configuration.IneligibleConfigurationAppliedError)
if options.incoherentCriterionFlag:
+ errorToIgnore.append(ParsePFWlog.ChangeRequestOnUnknownCriterion)
+
+ if options.unknwonCriterionFlag:
errorToIgnore.append(Criterion.ChangeRequestToNonAccessibleState)
self.errorToIgnore = tuple(errorToIgnore)