1 /******************************************************************************* 2 * Copyright (c) 2009, 2015 Mountainminds GmbH & Co. KG and Contributors 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * Marc R. Hoffmann - initial API and implementation 10 * 11 *******************************************************************************/ 12 package org.jacoco.core.test.perf; 13 14 import java.io.PrintWriter; 15 16 import org.jacoco.core.test.perf.targets.Target01; 17 import org.jacoco.core.test.perf.targets.Target02; 18 import org.jacoco.core.test.perf.targets.Target03; 19 20 /** 21 * The main test suite. 22 */ 23 public class PerformanceSuite implements IPerfScenario { 24 25 public void run(IPerfOutput output) throws Exception { 26 new ExecuteInstrumentedCodeScenario("plain method calls", 27 Target01.class).run(output); 28 new ExecuteInstrumentedCodeScenario("loop only", Target02.class) 29 .run(output); 30 new ExecuteInstrumentedCodeScenario("game of life", Target03.class) 31 .run(output); 32 new InstrumentationSizeSzenario(Target03.class).run(output); 33 new InstrumentationTimeScenario(Target03.class, 1000).run(output); 34 new AnalysisTimeScenario(Target03.class, 1000).run(output); 35 } 36 37 public static void main(String[] args) throws Exception { 38 final PrintWriter writer; 39 if (args.length == 0) { 40 writer = new PrintWriter(System.out, true); 41 } else { 42 writer = new PrintWriter(args[0]); 43 } 44 IPerfOutput output = new PerfOutputWriter(writer); 45 new PerformanceSuite().run(output); 46 writer.close(); 47 } 48 49 } 50