1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 13:35:22 +02:00

[test] Remove projects from workspace even on failures

If these tests fail, they cause a series of metadata corruption that
will render most/all test executed after as unreliable. Usually, there
is about ~150 test cases that fail without reason when one of these
fails.

Contributed by STMicroelectronics

Change-Id: Ic71ace8b6a55c49dd729d40385b245f12dbd6d85
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2021-10-28 21:20:14 +02:00
parent 6688a93e5f
commit 126cf32803

View file

@ -156,42 +156,42 @@ public class ManagedProject21MakefileTests extends TestCase {
return false;
boolean succeeded = true;
for (int i = 0; i < projects.length; i++) {
IProject curProject = projects[i];
try {
for (int i = 0; i < projects.length; i++) {
IProject curProject = projects[i];
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(curProject);
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(curProject);
//check whether the managed build info is converted
boolean isCompatible = UpdateManagedProjectManager.isCompatibleProject(info);
assertTrue(isCompatible);
//check whether the managed build info is converted
boolean isCompatible = UpdateManagedProjectManager.isCompatibleProject(info);
assertTrue(isCompatible);
if (isCompatible) {
// Build the project in order to generate the maekfiles
try {
curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
} catch (CoreException e) {
fail(e.getStatus().getMessage());
} catch (OperationCanceledException e) {
fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: "
+ e.getMessage());
}
if (isCompatible) {
// Build the project in order to generate the maekfiles
try {
curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
} catch (CoreException e) {
fail(e.getStatus().getMessage());
} catch (OperationCanceledException e) {
fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: "
+ e.getMessage());
}
//compare the generated makefiles to their benchmarks
if (files != null && files.length > 0) {
if (i == 0) {
String configName = info.getDefaultConfiguration().getName();
IPath buildDir = Path.fromOSString(configName);
// succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files);
IPath benchmarkLocationBase = resourcesLocation.append(benchmarkDir);
IPath buildLocation = curProject.getLocation().append(buildDir);
succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildLocation, files,
benchmarkLocationBase);
//compare the generated makefiles to their benchmarks
if (files != null && files.length > 0) {
if (i == 0) {
String configName = info.getDefaultConfiguration().getName();
IPath buildDir = Path.fromOSString(configName);
// succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files);
IPath benchmarkLocationBase = resourcesLocation.append(benchmarkDir);
IPath buildLocation = curProject.getLocation().append(buildDir);
succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildLocation, files,
benchmarkLocationBase);
}
}
}
}
}
if (succeeded) { // Otherwise leave the projects around for comparison
} finally {
for (int i = 0; i < projects.length; i++)
ManagedBuildTestHelper.removeProject(projects[i].getName());
}