From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qphoe-0005c7-Tf for garchives@archives.gentoo.org; Sat, 06 Aug 2011 14:25:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB25921C116; Sat, 6 Aug 2011 14:25:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A76E521C116 for ; Sat, 6 Aug 2011 14:25:01 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B50251B400F for ; Sat, 6 Aug 2011 14:25:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0D63580043 for ; Sat, 6 Aug 2011 14:25:00 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <70309748c5aed377605a27d6b0cca20465833e28.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/, pmstestsuite/output/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: pmstestsuite/library/case.py pmstestsuite/output/html.py X-VCS-Directories: pmstestsuite/library/ pmstestsuite/output/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 70309748c5aed377605a27d6b0cca20465833e28 Date: Sat, 6 Aug 2011 14:25:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 6d93d23ab9490cceb1182eea11a22e9a commit: 70309748c5aed377605a27d6b0cca20465833e28 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sat Aug 6 13:38:51 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sat Aug 6 13:51:35 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D70309748 Introduce the concept of undefined behavior assertions. --- pmstestsuite/library/case.py | 13 +++++++++++-- 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 =3D name + self._undefined =3D False =20 @property def name(self): return self._name =20 + @property + def undefined(self): + return self._undefined + @abstractproperty def expected(self): pass @@ -198,9 +203,13 @@ class TestCase(ABCObject): """ pass =20 - def _append_assert(self, a): + def _append_assert(self, a, undefined =3D False): + all_eapis =3D itertools.chain.from_iterable(self.supported_eapis) + if undefined: + a._undefined =3D True + self.assertions.append(a) - if not a: + if not a.undefined and not a: raise AssertionError(str(a)) =20 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=3D"value %s"' % self._color_class) =20 class ColorValCell(ValCell): - def __init__(self, text, cond): - self._color_class =3D 'good' if cond else 'bad' + def __init__(self, text, a): + self._color_class =3D 'unknown' if a.undefined \ + else 'good' if a else 'bad' ValCell.__init__(self, text) =20 class BoolCell(ValCell):