aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authoraclement <aclement>2008-04-01 21:30:57 +0000
committeraclement <aclement>2008-04-01 21:30:57 +0000
commit7e9072ea7018b0aa9eac66d9cf2264b977ba0283 (patch)
tree2b5f8198f3d617a0fb721944056d6fedf4385f5b /tests/src
parent7c2380f228ab7279e53afb246ab50ee59872a0c3 (diff)
downloadaspectj-7e9072ea7018b0aa9eac66d9cf2264b977ba0283.tar.gz
aspectj-7e9072ea7018b0aa9eac66d9cf2264b977ba0283.zip
221427: optimizing project rebuilds
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java1
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java55
3 files changed, 56 insertions, 4 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
index bffa739ea..5c5fc64e9 100644
--- a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
@@ -34,9 +34,9 @@ public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testLTWITDs_pr223094() {
runTest("ltw inherited itds");
}
- // public void testBrokenIfArgsCflowAtAj_pr145018() {
+ // public void testBrokenIfArgsCflowAtAj_pr145018() {
// runTest("ataj crashing with cflow, if and args");
- // }
+ // }
// public void testClassCastOnArrayType_pr180264() {
// runTest("classcastexception on array type");
// }
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
index f27535a2a..0f12baba3 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
@@ -395,6 +395,7 @@ public class AjdeInteractionTestbed extends TestCase {
// public void recordInformation(String s) { decisions.append(s).append("\n");}
public void recordDecision(String s) {
decisions.append(s).append("\n");
+ log(s);
}
};
} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index 9931eced0..ea9d7267f 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -520,8 +520,8 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
checkWasntFullBuild();
alter("P1","inc3"); // structurally changes one of the classes
build("P1");
- build("P2"); // build notices the structural change
- checkWasFullBuild();
+ build("P2"); // build notices the structural change, but is incremental of I and J as they depend on C
+ checkWasntFullBuild();
alter("P1","inc4");
build("P1");
build("P2"); // build sees a change but works out its not structural
@@ -969,6 +969,57 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
// aspect hasn't changed
}
+ public void testIncrementalIntelligence_Scenario01() {
+ AjdeInteractionTestbed.VERBOSE=true;
+ initialiseProject("Project1");
+ initialiseProject("Project2");
+ configureNewProjectDependency("Project2", "Project1");
+ build("Project1");
+ build("Project2");
+
+ alter("Project1", "inc1"); // white space change to ClassA - no impact
+ build("Project1");
+ build("Project2");
+ checkWasntFullBuild(); // not a structural change so ignored
+
+ alter("Project1", "inc2"); // structural change to ClassB - new method!
+ build("Project1");
+ build("Project2");
+ checkWasntFullBuild(); // not a type that Project2 depends on so ignored
+
+ alter("Project1", "inc3"); // structural change to ClassA
+ build("Project1");
+ build("Project2");
+ checkWasntFullBuild(); // Just need to recompile ClassAExtender
+ checkCompileWeaveCount("Project2", 1, 1);
+ checkCompiled("Project2", "ClassAExtender");
+
+ alter("Project2", "inc1"); // New type that depends on ClassAExtender
+ build("Project1");
+ build("Project2");
+ checkWasntFullBuild(); // Just build ClassAExtenderExtender
+
+ alter("Project1", "inc4"); // another structural change to ClassA
+ build("Project1");
+ build("Project2");
+ checkWasntFullBuild(); // Should rebuild ClassAExtender and ClassAExtenderExtender
+ checkCompileWeaveCount("Project2", 2, 2);
+ checkCompiled("Project2", "ClassAExtenderExtender");
+
+
+ }
+
+ private void checkCompiled(String projectName, String typeNameSubstring) {
+ List files = getCompiledFiles(projectName);
+ boolean found = false;
+ for (Iterator iterator = files.iterator(); iterator.hasNext();) {
+ String object = (String) iterator.next();
+ if (object.indexOf(typeNameSubstring) != -1)
+ found = true;
+ }
+ assertTrue("Did not find '" + typeNameSubstring + "' in list of compiled files", found);
+ }
+
// Case001: renaming a private field in a type
/* public void testPrReducingDependentBuilds_001_221427() {
AjdeInteractionTestbed.VERBOSE=true;