ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.113 by dl, Sun Sep 8 23:00:36 2013 UTC vs.
Revision 1.114 by jsr166, Tue Sep 17 06:38:36 2013 UTC

# Line 26 | Line 26 | import java.util.concurrent.atomic.Atomi
26   import java.util.concurrent.atomic.AtomicReference;
27   import static java.util.concurrent.TimeUnit.MILLISECONDS;
28   import static java.util.concurrent.TimeUnit.NANOSECONDS;
29 + import java.util.regex.Pattern;
30   import java.security.CodeSource;
31   import java.security.Permission;
32   import java.security.PermissionCollection;
# Line 134 | Line 135 | public class JSR166TestCase extends Test
135      private static final int runsPerTest =
136          Integer.getInteger("jsr166.runsPerTest", 1);
137  
138 +    /**
139 +     * A filter for tests to run, matching strings of the form
140 +     * methodName(className), e.g. "testInvokeAll5(ForkJoinPoolTest)"
141 +     * Usefully combined with jsr166.runsPerTest.
142 +     */
143 +    private static final Pattern methodFilter = methodFilter();
144 +
145 +    private static Pattern methodFilter() {
146 +        String regex = System.getProperty("jsr166.methodFilter");
147 +        return (regex == null) ? null : Pattern.compile(regex);
148 +    }
149 +
150      protected void runTest() throws Throwable {
151 <        for (int i = 0; i < runsPerTest; i++) {
152 <            if (profileTests)
153 <                runTestProfiled();
154 <            else
155 <                super.runTest();
151 >        if (methodFilter == null
152 >            || methodFilter.matcher(toString()).find()) {
153 >            for (int i = 0; i < runsPerTest; i++) {
154 >                if (profileTests)
155 >                    runTestProfiled();
156 >                else
157 >                    super.runTest();
158 >            }
159          }
160      }
161  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines