1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 06:25:23 +02:00

Fix runcontrol test on Windows. If the program is built with cygwin, there is an additional thread.

This commit is contained in:
John Cortell 2010-03-04 16:43:00 +00:00
parent 21e26009ef
commit 7eb06f6213

View file

@ -41,6 +41,7 @@ import org.eclipse.cdt.tests.dsf.gdb.framework.ServiceEventWaitor;
import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil; import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil;
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin; import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.junit.After; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
@ -146,9 +147,17 @@ public class MIRunControlTest extends BaseTestCase {
// Context can not be null // Context can not be null
if (ctxts == null) if (ctxts == null)
Assert.fail("Context returned is null. At least one context should have been returned"); Assert.fail("Context returned is null. At least one context should have been returned");
else { // Only one Context in this case else {
if (ctxts.length > 1) if (Platform.getOS().equals(Platform.OS_WIN32)) {
Assert.fail("Context returned can not be more than 1. This test case is for single context application."); // If the target app was built with cygwin, there will be two
// threads--even for the most simple program. Apparently,
// something the cygwin runtime/emulation needs.
Assert.assertTrue("Context returned should not be more than 2. This test case is for single context application.", 1 <= ctxts.length && ctxts.length <= 2);
}
else {
// Only one Context in this case
Assert.assertTrue("Context returned should not be more than 1. This test case is for single context application.", ctxts.length == 1);
}
IMIExecutionDMContext dmc = (IMIExecutionDMContext) ctxts[0]; IMIExecutionDMContext dmc = (IMIExecutionDMContext) ctxts[0];
// Thread id for the main thread should be one // Thread id for the main thread should be one