mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
codan tests - removed sleeps and made sure it runs in non-ui thread
Change-Id: Ic684e647ea43968c7da35e0f9448e01e66c06e8f
This commit is contained in:
parent
2fca26b8e5
commit
32d1a28f49
1 changed files with 23 additions and 12 deletions
|
@ -81,11 +81,17 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
|||
|
||||
@Override
|
||||
public void tearDown() throws CoreException {
|
||||
IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
|
||||
for (IWorkbenchPage page : pages) {
|
||||
page.closeAllEditors(false);
|
||||
dispatch(200);
|
||||
}
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
|
||||
for (IWorkbenchPage page : pages) {
|
||||
page.closeAllEditors(false);
|
||||
dispatch(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
|
@ -107,18 +113,23 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
|||
// need to load before running codan because otherwise marker is lost when doing quick fix 8[]
|
||||
runCodan();
|
||||
doRunQuickFix();
|
||||
dispatch(500);
|
||||
String result = TestUtils.loadFile(currentIFile.getContents());
|
||||
return result;
|
||||
}
|
||||
|
||||
public void doRunQuickFix() {
|
||||
for (int i = 0; i < markers.length; i++) {
|
||||
IMarker marker = markers[i];
|
||||
quickFix.run(marker);
|
||||
dispatch(200);
|
||||
}
|
||||
PlatformUI.getWorkbench().saveAllEditors(false);
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < markers.length; i++) {
|
||||
IMarker marker = markers[i];
|
||||
quickFix.run(marker);
|
||||
dispatch(0);
|
||||
}
|
||||
PlatformUI.getWorkbench().saveAllEditors(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue