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:
parent
6688a93e5f
commit
126cf32803
1 changed files with 29 additions and 29 deletions
|
@ -156,42 +156,42 @@ public class ManagedProject21MakefileTests extends TestCase {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
boolean succeeded = true;
|
boolean succeeded = true;
|
||||||
for (int i = 0; i < projects.length; i++) {
|
try {
|
||||||
IProject curProject = projects[i];
|
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
|
//check whether the managed build info is converted
|
||||||
boolean isCompatible = UpdateManagedProjectManager.isCompatibleProject(info);
|
boolean isCompatible = UpdateManagedProjectManager.isCompatibleProject(info);
|
||||||
assertTrue(isCompatible);
|
assertTrue(isCompatible);
|
||||||
|
|
||||||
if (isCompatible) {
|
if (isCompatible) {
|
||||||
// Build the project in order to generate the maekfiles
|
// Build the project in order to generate the maekfiles
|
||||||
try {
|
try {
|
||||||
curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
|
curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
fail(e.getStatus().getMessage());
|
fail(e.getStatus().getMessage());
|
||||||
} catch (OperationCanceledException e) {
|
} catch (OperationCanceledException e) {
|
||||||
fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: "
|
fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: "
|
||||||
+ e.getMessage());
|
+ e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
//compare the generated makefiles to their benchmarks
|
//compare the generated makefiles to their benchmarks
|
||||||
if (files != null && files.length > 0) {
|
if (files != null && files.length > 0) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
String configName = info.getDefaultConfiguration().getName();
|
String configName = info.getDefaultConfiguration().getName();
|
||||||
IPath buildDir = Path.fromOSString(configName);
|
IPath buildDir = Path.fromOSString(configName);
|
||||||
// succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files);
|
// succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildDir, files);
|
||||||
IPath benchmarkLocationBase = resourcesLocation.append(benchmarkDir);
|
IPath benchmarkLocationBase = resourcesLocation.append(benchmarkDir);
|
||||||
IPath buildLocation = curProject.getLocation().append(buildDir);
|
IPath buildLocation = curProject.getLocation().append(buildDir);
|
||||||
succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildLocation, files,
|
succeeded = ManagedBuildTestHelper.compareBenchmarks(curProject, buildLocation, files,
|
||||||
benchmarkLocationBase);
|
benchmarkLocationBase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} finally {
|
||||||
|
|
||||||
if (succeeded) { // Otherwise leave the projects around for comparison
|
|
||||||
for (int i = 0; i < projects.length; i++)
|
for (int i = 0; i < projects.length; i++)
|
||||||
ManagedBuildTestHelper.removeProject(projects[i].getName());
|
ManagedBuildTestHelper.removeProject(projects[i].getName());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue