diff options
author | Michał Górny <mgorny@gentoo.org> | 2011-08-06 15:38:51 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2011-08-06 15:51:35 +0200 |
commit | 70309748c5aed377605a27d6b0cca20465833e28 (patch) | |
tree | b5de8c1d9d83c649737b00dfe84354d96d8fa039 | |
parent | Introduce the concept of EAPI groups rather than relevant+supported. (diff) | |
download | pms-test-suite-70309748c5aed377605a27d6b0cca20465833e28.tar.gz pms-test-suite-70309748c5aed377605a27d6b0cca20465833e28.tar.bz2 pms-test-suite-70309748c5aed377605a27d6b0cca20465833e28.zip |
Introduce the concept of undefined behavior assertions.
-rw-r--r-- | pmstestsuite/library/case.py | 13 | ||||
-rw-r--r-- | pmstestsuite/output/html.py | 5 |
2 files changed, 14 insertions, 4 deletions
diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py index f8f4ce3..538a050 100644 --- a/pmstestsuite/library/case.py +++ b/pmstestsuite/library/case.py @@ -60,11 +60,16 @@ def cleanup_test_case_name(classname): class AssertionResult(ABCObject, BoolCompat): def __init__(self, name): self._name = name + self._undefined = False @property def name(self): return self._name + @property + def undefined(self): + return self._undefined + @abstractproperty def expected(self): pass @@ -198,9 +203,13 @@ class TestCase(ABCObject): """ pass - def _append_assert(self, a): + def _append_assert(self, a, undefined = False): + all_eapis = itertools.chain.from_iterable(self.supported_eapis) + if undefined: + a._undefined = True + self.assertions.append(a) - if not a: + if not a.undefined and not a: raise AssertionError(str(a)) def assertTrue(self, cond, msg): diff --git a/pmstestsuite/output/html.py b/pmstestsuite/output/html.py index 519209a..6de16f0 100644 --- a/pmstestsuite/output/html.py +++ b/pmstestsuite/output/html.py @@ -108,8 +108,9 @@ class HTMLOutput(OutputModule): self._attrs.append('class="value %s"' % self._color_class) class ColorValCell(ValCell): - def __init__(self, text, cond): - self._color_class = 'good' if cond else 'bad' + def __init__(self, text, a): + self._color_class = 'unknown' if a.undefined \ + else 'good' if a else 'bad' ValCell.__init__(self, text) class BoolCell(ValCell): |