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.170 by jsr166, Thu Oct 8 22:39:57 2015 UTC vs.
Revision 1.171 by jsr166, Thu Oct 8 23:06:01 2015 UTC

# Line 20 | Line 20 | import java.lang.management.ThreadMXBean
20   import java.lang.reflect.Constructor;
21   import java.lang.reflect.Method;
22   import java.lang.reflect.Modifier;
23 + import java.nio.file.Files;
24 + import java.nio.file.Paths;
25   import java.security.CodeSource;
26   import java.security.Permission;
27   import java.security.PermissionCollection;
# Line 52 | Line 54 | import java.util.concurrent.ThreadFactor
54   import java.util.concurrent.ThreadPoolExecutor;
55   import java.util.concurrent.TimeoutException;
56   import java.util.concurrent.atomic.AtomicReference;
57 + import java.util.regex.Matcher;
58   import java.util.regex.Pattern;
59  
60   import junit.framework.AssertionFailedError;
# Line 207 | Line 210 | public class JSR166TestCase extends Test
210                           + lastTestCase + " (" + currentRun + "/" + runsPerTest + ")");
211                      System.err.println("availableProcessors=" +
212                          Runtime.getRuntime().availableProcessors());
213 +                    System.err.printf("cpu model = %s%n", cpuModel());
214                      dumpTestThreads();
215                      // one stack dump is probably enough; more would be spam
216                      break;
# Line 218 | Line 222 | public class JSR166TestCase extends Test
222          thread.start();
223      }
224  
225 +    public static String cpuModel() {
226 +        try {
227 +            Matcher matcher = Pattern.compile("model name\\s*: (.*)")
228 +                .matcher(new String(
229 +                     Files.readAllBytes(Paths.get("/proc/cpuinfo")), "UTF-8"));
230 +            matcher.find();
231 +            return matcher.group(1);
232 +        } catch (Exception ex) { return null; }
233 +    }
234 +
235      public void runBare() throws Throwable {
236          currentTestCase = this;
237          if (methodFilter == null

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines