diff options
author | Silenio Quarti <silenio> | 2005-08-22 17:43:06 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-08-22 17:43:06 +0000 |
commit | 7a6c152bfc42500b422bc19808be27df1677ef13 (patch) | |
tree | 319cc8c2b76f4b2d4522aa18294c26c69a1db69c /tests | |
parent | 284044de2948ceb46f55d2a55a064618477a8303 (diff) | |
download | eclipse.platform.swt-7a6c152bfc42500b422bc19808be27df1677ef13.tar.gz eclipse.platform.swt-7a6c152bfc42500b422bc19808be27df1677ef13.tar.xz eclipse.platform.swt-7a6c152bfc42500b422bc19808be27df1677ef13.zip |
initial
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCarbonTests.java | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCarbonTests.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCarbonTests.java new file mode 100644 index 0000000000..e87efde34f --- /dev/null +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCarbonTests.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.tests.junit; + + +import junit.framework.*; +import junit.textui.*; + +/** + * Suite for running all SWT test cases. + */ +public class AllCarbonTests extends TestSuite { + +/** + * Tests not run because they consistently fail + */ +static String[] excludeTests = { + "test_setBackgroundLorg_eclipse_swt_graphics_Color(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image)", + "test_ConstructorLorg_eclipse_swt_graphics_Device$Lorg_eclipse_swt_graphics_FontData(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Font)", + "test_copyAreaIIIIII(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_GC)", + "test_copyAreaLorg_eclipse_swt_graphics_ImageII(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_GC)", + "test_getBoundsI(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TableItem)", + "test_getBoundsI(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TreeItem)", + "test_getBounds(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_TreeItem)", + "test_appendLjava_lang_String(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)", + "test_getDoubleClickEnabled(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)", + "test_getTopPixel(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)", + "test_setDoubleClickEnabledZ(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)", + "test_setTabsI(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)", + "test_setTopIndexI(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)", + "test_setSelection$Lorg_eclipse_swt_widgets_TreeItem(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Tree)", + "test_setTopItemLorg_eclipse_swt_widgets_TreeItem(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Tree)", + "test_clearSelection(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "test_copy(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "test_cut(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "test_getSelection(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "test_getSelectionIndex(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "test_paste(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "test_setSelectionLorg_eclipse_swt_graphics_Point(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Combo)", + "Browser4(org.eclipse.swt.tests.junit.browser.Test_BrowserSuite)", +}; + +static boolean isExcluded(String name) { + for (int i = 0; i < excludeTests.length; i++) { + if (name.equals(excludeTests[i])) return true; + } + return false; +} + +public static void main(String[] args) { + SwtTestCase.unimplementedMethods = 0; + TestRunner.run(suite()); + if (SwtTestCase.unimplementedMethods > 0) { + System.out.println("\nCalls to warnUnimpl: " + SwtTestCase.unimplementedMethods); + System.out.println("\nExcluded Tests: " + excludeTests.length); + } +} +public static Test suite() { + TestSuite fullSuite = (TestSuite)AllTests.suite(); + TestSuite filteredSuite = new TestSuite(); + for (int i = 0; i < fullSuite.testCount(); i++) { + Test candidateTest = fullSuite.testAt(i); + if (candidateTest instanceof TestSuite) { + TestSuite suite = (TestSuite)candidateTest; + for (int j = 0; j < suite.testCount(); j++) { + Test test = suite.testAt(j); + if (!isExcluded(test.toString())) filteredSuite.addTest(test); + } + } + } + return filteredSuite; +} +} |