Skip to content

Commit 6a470d4

Browse files
author
jan
committed
Do not clean projects at the end of a test build
1 parent c596bbc commit 6a470d4

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

io.sloeber.tests/src/io/sloeber/core/Shared.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ public static String buildAndVerifyGivenBuilders(String projectName, BoardDescri
236236
IProject theTestProject = null;
237237
NullProgressMonitor monitor = new NullProgressMonitor();
238238
Shared.buildCounter++;
239-
boolean projectFreshlyCreated = true;
240239

241240
for (String curBuilder : builders) {
242241
if (theTestProject == null) {
@@ -247,18 +246,17 @@ public static String buildAndVerifyGivenBuilders(String projectName, BoardDescri
247246
compileOptions, curBuilder, monitor);
248247
waitForAllJobsToFinish();
249248
}
250-
// do not set the build tool when the project is freshly created because then
251-
// the default case would never be tested
252-
if (!projectFreshlyCreated) {
253-
// set the builder
254-
CoreModel coreModel = CoreModel.getDefault();
255-
ICProjectDescription projectDescription = coreModel.getProjectDescription(theTestProject, true);
256-
IAutoBuildConfigurationDescription autoDesc = IAutoBuildConfigurationDescription
257-
.getActiveConfig(projectDescription);
258-
autoDesc.setBuilder(curBuilder);
259-
coreModel.setProjectDescription(theTestProject, projectDescription);
260-
}
261-
projectFreshlyCreated = false;
249+
// clean so we will get a full build for this buider
250+
theTestProject.build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
251+
252+
// set the builder
253+
CoreModel coreModel = CoreModel.getDefault();
254+
ICProjectDescription projectDescription = coreModel.getProjectDescription(theTestProject, true);
255+
IAutoBuildConfigurationDescription autoDesc = IAutoBuildConfigurationDescription
256+
.getActiveConfig(projectDescription);
257+
autoDesc.setBuilder(curBuilder);
258+
coreModel.setProjectDescription(theTestProject, projectDescription);
259+
262260
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
263261

264262
if (hasBuildErrors(theTestProject)!=null) {
@@ -276,8 +274,7 @@ public static String buildAndVerifyGivenBuilders(String projectName, BoardDescri
276274
}
277275
}
278276
}
279-
// clean so we will get a full build at the next build
280-
theTestProject.build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
277+
281278
}
282279
if (!myLastFailMessage.isBlank()) {
283280
if (myCloseFailedProjectsSetting && theTestProject!=null) {

0 commit comments

Comments
 (0)