diff options
author | Kevin Rocard <kevinx.rocard@intel.com> | 2013-06-14 18:09:54 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:04:01 +0100 |
commit | cf031996ede8428065b6d7648e34720a1874f5fa (patch) | |
tree | 31d1319419df5f728486d2b0dd0412f4a306c233 /tools | |
parent | 2e40452ca53b4eef0e4a254951dee968a07f1797 (diff) | |
download | external_parameter-framework-cf031996ede8428065b6d7648e34720a1874f5fa.zip external_parameter-framework-cf031996ede8428065b6d7648e34720a1874f5fa.tar.gz external_parameter-framework-cf031996ede8428065b6d7648e34720a1874f5fa.tar.bz2 |
[coverage] Lazy rule evaluation
BZ: 115218
The all and any rule were not lazy. This was a mismatch with the PFW.
Make all and any compound rules lazy.
Change-Id: If29e3b3f888be40ebf4027d318ae6017396d4d7b
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/114694
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/coverage.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/coverage.py b/tools/coverage.py index a6d6fa6..8aa941f 100755 --- a/tools/coverage.py +++ b/tools/coverage.py @@ -374,8 +374,11 @@ class Rule(Element): def _isApplicable(self, criteria, childApplicability): - # Forcing evaluation of all child by the list creation - return all(list(childApplicability)) + """Return the rule applicability depending on children applicability. + + If at least one child is applicable, return true""" + # Lazy evaluation as in the PFW + return all(childApplicability) class CriterionRule(FromDomElement, DomPopulatedElement, Rule): @@ -426,8 +429,8 @@ class CompoundRule(FromDomElement, DomPopulatedElement, Rule): if self.ofTypeAll : applicability = super()._isApplicable(criteria, childApplicability) else: - # Forcing evaluation of all child by the list creation - applicability = any(list(childApplicability)) + # Lazy evaluation as in the PFW + applicability = any(childApplicability) return applicability |