From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/
Date: Thu, 11 Aug 2011 22:09:10 +0000 (UTC) [thread overview]
Message-ID: <07fb0188ef5b99c66b416953223d16a12e792f68.mgorny@gentoo> (raw)
commit: 07fb0188ef5b99c66b416953223d16a12e792f68
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 11 21:38:42 2011 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 11 21:38:42 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=07fb0188
Prefix dep assertions and add them to assert list.
---
pmstestsuite/library/depend_case.py | 45 ++++++++++++++++++++++++++++++++--
1 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/pmstestsuite/library/depend_case.py b/pmstestsuite/library/depend_case.py
index 1185a16..55e49cc 100644
--- a/pmstestsuite/library/depend_case.py
+++ b/pmstestsuite/library/depend_case.py
@@ -2,9 +2,44 @@
# (c) 2011 Michał Górny <mgorny@gentoo.org>
# Released under the terms of the 2-clause BSD license.
-from pmstestsuite.library.case import EbuildTestCase
+from pmstestsuite.library.case import EbuildTestCase, AssertionResult
from pmstestsuite.library.eclass_case import EclassTestCase
+class DepWrappedAssertion(AssertionResult):
+ def __init__(self, assertion, prefix):
+ self._assert = assertion
+ self._prefix = prefix
+
+ @property
+ def name(self):
+ return '[%s] %s' % (self._prefix, self._assert.name)
+
+ @property
+ def prefix(self):
+ return self._prefix
+
+ @property
+ def unprefixed_name(self):
+ return self._assert.name
+
+ @property
+ def undefined(self):
+ return self._assert.undefined
+
+ @property
+ def expected(self):
+ return self._assert.expected
+
+ @property
+ def actual(self):
+ return self._assert.actual
+
+ def __bool__(self):
+ return bool(self._assert)
+
+ def __str__(self):
+ return str(self._assert)
+
class BaseDependencyTestCase(object):
"""
@cvar depend_classes: classes for C{DEPEND} generation
@@ -33,8 +68,9 @@ class BaseDependencyTestCase(object):
if v not in self.ebuild_vars:
self.ebuild_vars[v] = ''
- for d in class_list:
+ for i, d in enumerate(class_list):
o = d(*args, **kwargs)
+ o._dep_prefix = '%s %d' % (v[:-3], i)
self.ebuild_vars[v] += '\n\t=%s' % o.cpv
self.dependant_ebuilds.append(o)
@@ -49,6 +85,8 @@ class BaseDependencyTestCase(object):
def check_result(self, pm):
for o in self.dependant_ebuilds:
o.check_result(pm)
+ self.assertions.extend([DepWrappedAssertion(x, o._dep_prefix)
+ for x in o.assertions])
class EbuildDependencyTestCase(BaseDependencyTestCase, EbuildTestCase):
"""
@@ -124,8 +162,9 @@ class EclassDependencyTestCase(BaseDependencyTestCase, EclassTestCase):
(self.eclass_pdepend_classes, 'PDEPEND')):
ev = ''
- for d in class_list:
+ for i, d in enumerate(class_list):
o = d(*args, **kwargs)
+ o._dep_prefix = 'eclass %s %d' % (v[:-3], i)
ev += '\n\t=%s' % o.cpv
self.dependant_ebuilds.append(o)
self.eclass_contents = '%s="%s"\n%s' % (v, ev,
next reply other threads:[~2011-08-11 22:09 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 22:09 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-01-03 15:52 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/ Michał Górny
2012-01-02 22:26 Michał Górny
2011-08-12 20:55 Michał Górny
2011-08-11 22:09 Michał Górny
2011-08-11 8:54 Michał Górny
2011-08-11 8:53 Michał Górny
2011-08-06 14:26 Michał Górny
2011-08-06 14:25 Michał Górny
2011-08-06 14:25 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 8:17 Michał Górny
2011-08-02 18:53 Michał Górny
2011-08-02 18:53 Michał Górny
2011-08-02 18:53 Michał Górny
2011-08-02 18:53 Michał Górny
2011-07-24 14:37 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-23 21:14 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/ Michał Górny
2011-06-23 21:14 Michał Górny
2011-06-20 19:20 Michał Górny
2011-06-17 15:07 Michał Górny
2011-06-17 5:59 Michał Górny
2011-06-16 19:49 Michał Górny
2011-06-16 19:49 Michał Górny
2011-06-14 12:35 Michał Górny
2011-06-14 8:32 Michał Górny
2011-06-14 8:32 Michał Górny
2011-06-13 19:16 Michał Górny
2011-06-13 19:16 Michał Górny
2011-06-07 17:22 Michał Górny
2011-06-03 17:36 Michał Górny
2011-05-31 17:19 Michał Górny
2011-05-29 18:57 Michał Górny
2011-05-29 18:57 Michał Górny
2011-05-29 18:57 Michał Górny
2011-05-29 18:17 Michał Górny
2011-05-26 7:25 Michał Górny
2011-05-26 6:35 Michał Górny
2011-05-25 20:40 Michał Górny
2011-05-24 14:28 Michał Górny
2011-05-24 8:11 Michał Górny
2011-05-24 8:11 Michał Górny
2011-05-24 8:11 Michał Górny
2011-05-23 11:52 Michał Górny
2011-05-23 9:51 Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07fb0188ef5b99c66b416953223d16a12e792f68.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox