On 06/22/12 13:27, Dave Vadovszki wrote:
I have a small change ready for review (7138290 combining -o and -s for
run.py results in traceback). I've been sitting on it for while trying
to otherwise enhance/fix the the find_tests function, but I decided to
write another CR to cover the separate issue: 7179205

# HG changeset patch
# User Dave Vadovszki <dave.vadovs...@oracle.com>
# Date 1340395255 21600
# Node ID 8c4794d551932185c97021f28b6b6b155e014423
# Parent ea23b3b706718f33f569d3ea95a833958d69985e
7138290 combining -o and -s for run.py results in traceback

diff --git a/src/tests/run.py b/src/tests/run.py
--- a/src/tests/run.py
+++ b/src/tests/run.py
@@ -171,10 +171,12 @@
filename, cname, attrname)
# Remove this function from our class obj if
# it doesn't match the test pattern
- if re.search(startatpat, full):
- seen = True
if not seen:
- delattr(classobj, attrname)
+ if re.search(startatpat, full):
+ seen = True
+ else:
+ delattr(classobj, attrname)
+ continue
found = reduce(lambda x, y: x or y,
[ re.search(pat, full) for pat in pats ],
None)



The current implementation deletes tests until the -s pattern matches.
Unfortunately this happens before the tests are sorted, so you don't
always get expected behavior. Weeding out tests after the sorted call
has happened involves digging into private TestSuite._tests members,
which is doable, but messy and hackish IMHO.

LGTM,
-Shawn

_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to