Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKevin Barnes2009-04-01 18:47:34 +0000
committerKevin Barnes2009-04-01 18:47:34 +0000
commite4adaa4f10e173e6ea3e2e6198b4cba8b36aba32 (patch)
tree5e8a0997be4190951cda5f768c4c14f42b59c3d5 /tests
parentfcf035261a778f9d1a193d18b728987b0a24b5f2 (diff)
downloadeclipse.platform.swt-e4adaa4f10e173e6ea3e2e6198b4cba8b36aba32.tar.gz
eclipse.platform.swt-e4adaa4f10e173e6ea3e2e6198b4cba8b36aba32.tar.xz
eclipse.platform.swt-e4adaa4f10e173e6ea3e2e6198b4cba8b36aba32.zip
AllCocoaTests
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCocoaTests.java64
-rw-r--r--tests/org.eclipse.swt.tests/test.xml7
2 files changed, 69 insertions, 2 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCocoaTests.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCocoaTests.java
new file mode 100644
index 0000000000..37f992acdd
--- /dev/null
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllCocoaTests.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 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 AllCocoaTests extends TestSuite {
+
+/**
+ * Tests not run because they consistently fail
+ */
+static String[] excludeTests = {
+ "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_getTopPixel(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Text)",
+ "test_postLorg_eclipse_swt_widgets_Event(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Display)",
+};
+
+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;
+}
+}
diff --git a/tests/org.eclipse.swt.tests/test.xml b/tests/org.eclipse.swt.tests/test.xml
index df0c23b1e5..1e4d062b35 100644
--- a/tests/org.eclipse.swt.tests/test.xml
+++ b/tests/org.eclipse.swt.tests/test.xml
@@ -30,8 +30,11 @@
<condition property="class-tests" value="org.eclipse.swt.tests.junit.AllGtkTests">
<equals arg1="${os}" arg2="linux"/>
</condition>
- <condition property="class-tests" value="org.eclipse.swt.tests.junit.AllCarbonTests">
- <equals arg1="${os}" arg2="macosx"/>
+ <condition property="class-tests" value="org.eclipse.swt.tests.junit.AllCocoaTests">
+ <equals arg1="${ws}" arg2="cocoa"/>
+ </condition>
+ <condition property="class-tests" value="org.eclipse.swt.tests.junit.AllCarbonTests">
+ <equals arg1="${ws}" arg2="carbon"/>
</condition>
<condition property="class-tests" value="org.eclipse.swt.tests.junit.AllTests">
<equals arg1="${os}" arg2="win32"/>

Back to the top