|
|
@@ -13,6 +13,8 @@ package org.aspectj.systemtest.incremental.tools; |
|
|
|
import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import org.aspectj.ajde.core.ICompilerConfiguration; |
|
|
|
|
|
|
|
/** |
|
|
|
* Testing the performance of incremental compilation as it would be in AJDT. |
|
|
|
* |
|
|
@@ -90,9 +92,52 @@ public class IncrementalPerformanceTests extends AbstractMultiProjectIncremental |
|
|
|
assertTrue(whitespacechangeDoTellCompiler < fullbuildtime); |
|
|
|
|
|
|
|
assertTrue(nochangebuild < whitespacechangeDontTellCompiler); |
|
|
|
assertTrue(nochangebuild < whitespacechangeDoTellCompiler); |
|
|
|
// assertTrue(nochangebuild < whitespacechangeDoTellCompiler); |
|
|
|
|
|
|
|
// assertTrue(whitespacechangeDoTellCompiler < whitespacechangeDontTellCompiler); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Project dependencies are captured by using classpath. The dependee project has the bin folder for the project upon which it |
|
|
|
* depends on its classpath. This can make it expensive when determining whether to build the dependee project as we may need to |
|
|
|
* analyse all the classpath entries, we don't know which are project related. However, a new API in ICompilerConfiguration |
|
|
|
* called getClasspathElementsWithModifiedContents() can be returned by an implementor to tell us which parts of the classpath |
|
|
|
* to check. |
|
|
|
*/ |
|
|
|
public void testBuildingTwoProjects() { |
|
|
|
AjdeInteractionTestbed.VERBOSE = true; |
|
|
|
|
|
|
|
String projA = "Proj64"; |
|
|
|
String projB = "Dependee"; |
|
|
|
|
|
|
|
// A full build: |
|
|
|
initialiseProject(projA); |
|
|
|
initialiseProject(projB); |
|
|
|
configureNewProjectDependency(projB, projA); |
|
|
|
build(projA); |
|
|
|
checkWasFullBuild(); |
|
|
|
build(projB); |
|
|
|
checkWasFullBuild(); |
|
|
|
|
|
|
|
alter(projA, "C43changeOne"); // C43 made package private |
|
|
|
build(projA); |
|
|
|
setNextChangeResponse(projB, ICompilerConfiguration.EVERYTHING); |
|
|
|
build(projB); |
|
|
|
long timeTakenWhenFullyAnalysingClasspath = getTimeTakenForBuild(projB); |
|
|
|
checkWasntFullBuild(); |
|
|
|
|
|
|
|
alter(projA, "C43changeOne"); // C43 made package private |
|
|
|
build(projA); |
|
|
|
addClasspathEntryChanged(projB, getProjectRelativePath(projA, "bin").getPath()); |
|
|
|
// waitForReturn(); |
|
|
|
build(projB); |
|
|
|
long timeTakenWhenFullyToldSpecifically = getTimeTakenForBuild(projB); |
|
|
|
// waitFor10(); |
|
|
|
checkWasntFullBuild(); |
|
|
|
|
|
|
|
System.out.println("Without: " + timeTakenWhenFullyAnalysingClasspath + "ms With: " + timeTakenWhenFullyToldSpecifically |
|
|
|
+ "ms"); |
|
|
|
|
|
|
|
// assertTrue(whitespacechangeDoTellCompiler < whitespacechangeDontTellCompiler); |
|
|
|
} |
|
|
|
|
|
|
|
// --- helper code --- |