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
|
@Override
|
||||||
public void tearDown() throws CoreException {
|
public void tearDown() throws CoreException {
|
||||||
IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
|
Display.getDefault().syncExec(new Runnable() {
|
||||||
for (IWorkbenchPage page : pages) {
|
@Override
|
||||||
page.closeAllEditors(false);
|
public void run() {
|
||||||
dispatch(200);
|
IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
|
||||||
}
|
for (IWorkbenchPage page : pages) {
|
||||||
|
page.closeAllEditors(false);
|
||||||
|
dispatch(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
super.tearDown();
|
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[]
|
// need to load before running codan because otherwise marker is lost when doing quick fix 8[]
|
||||||
runCodan();
|
runCodan();
|
||||||
doRunQuickFix();
|
doRunQuickFix();
|
||||||
dispatch(500);
|
|
||||||
String result = TestUtils.loadFile(currentIFile.getContents());
|
String result = TestUtils.loadFile(currentIFile.getContents());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doRunQuickFix() {
|
public void doRunQuickFix() {
|
||||||
for (int i = 0; i < markers.length; i++) {
|
Display.getDefault().syncExec(new Runnable() {
|
||||||
IMarker marker = markers[i];
|
@Override
|
||||||
quickFix.run(marker);
|
public void run() {
|
||||||
dispatch(200);
|
for (int i = 0; i < markers.length; i++) {
|
||||||
}
|
IMarker marker = markers[i];
|
||||||
PlatformUI.getWorkbench().saveAllEditors(false);
|
quickFix.run(marker);
|
||||||
|
dispatch(0);
|
||||||
|
}
|
||||||
|
PlatformUI.getWorkbench().saveAllEditors(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue