--- jsr166/src/test/tck/JSR166TestCase.java 2014/05/14 21:06:38 1.115 +++ jsr166/src/test/tck/JSR166TestCase.java 2014/06/16 20:13:54 1.119 @@ -116,6 +116,13 @@ public class JSR166TestCase extends Test Boolean.getBoolean("jsr166.expensiveTests"); /** + * If true, also run tests that are not part of the official tck + * because they test unspecified implementation details. + */ + protected static final boolean testImplementationDetails = + Boolean.getBoolean("jsr166.testImplementationDetails"); + + /** * If true, report on stdout all "slow" tests, that is, ones that * take more than profileThreshold milliseconds to execute. */ @@ -160,12 +167,13 @@ public class JSR166TestCase extends Test } protected void runTestProfiled() throws Throwable { + // Warmup run, notably to trigger all needed classloading. + super.runTest(); long t0 = System.nanoTime(); try { super.runTest(); } finally { - long elapsedMillis = - (System.nanoTime() - t0) / (1000L * 1000L); + long elapsedMillis = millisElapsedSince(t0); if (elapsedMillis >= profileThreshold) System.out.printf("%n%s: %d%n", toString(), elapsedMillis); } @@ -901,7 +909,7 @@ public class JSR166TestCase extends Test * startNanoTime, which must have been previously returned from a * call to {@link System.nanoTime()}. */ - long millisElapsedSince(long startNanoTime) { + static long millisElapsedSince(long startNanoTime) { return NANOSECONDS.toMillis(System.nanoTime() - startNanoTime); }