I am trying to wrap caliper code in junit so that performance tests run as part of my unit tests. It seems to work - the caliper test actually runs, but it does not exit successfully. What is the correct way to install this material?
import static org.junit.Assert.*; import org.junit.Test; import com.google.caliper.Runner; import com.google.caliper.SimpleBenchmark; public class CaliperBenchmarkExample extends SimpleBenchmark { public void timeNanoTime(int reps) { for (int i = 0; i < reps; i++) { System.nanoTime(); } } @Test public void testPerformance() { Runner.main(CaliperBenchmarkExample.class, new String[] { }); assertTrue(true); } }
source share