Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2016-09-22 05:04:52 -0400
committerAlexander Kurtakov2016-10-31 06:38:50 -0400
commit2781c59a8cb8d0676c14382f6b967ef6423e53d2 (patch)
tree0710954c89bb31bf0415b0044aebfc05b6ff96d7
parentd26926ea92a3f08ae6759ca95f6b54e46f46a3b6 (diff)
downloadeclipse.platform.swt-2781c59a8cb8d0676c14382f6b967ef6423e53d2.tar.gz
eclipse.platform.swt-2781c59a8cb8d0676c14382f6b967ef6423e53d2.tar.xz
eclipse.platform.swt-2781c59a8cb8d0676c14382f6b967ef6423e53d2.zip
Bug 431319 - Run SWT tests with plain surefire (not Tycho/OSGi one)
This configures the tests to run with the plain Java maven-surefire-plugin. To do so, it requires a feature listing all platform-specific fragments that we add as a dependency, and to make target resolution platform-specific. Then Tycho generates a good classpath that's consumed by maven-surefire-plugin. Printing is disabled as the tests are failing with tycho. Change-Id: Ibba7c64757fb8ec71aff04c850e35309440e3caa Signed-off-by: Mickael Istria <mistria@redhat.com> Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--pom.xml1
-rw-r--r--tests/org.eclipse.swt.tests.fragments.feature/.project17
-rw-r--r--tests/org.eclipse.swt.tests.fragments.feature/build.properties13
-rw-r--r--tests/org.eclipse.swt.tests.fragments.feature/feature.properties24
-rw-r--r--tests/org.eclipse.swt.tests.fragments.feature/feature.xml110
-rw-r--r--tests/org.eclipse.swt.tests.fragments.feature/pom.xml25
-rw-r--r--tests/org.eclipse.swt.tests/pom.xml47
7 files changed, 234 insertions, 3 deletions
diff --git a/pom.xml b/pom.xml
index 8678fa88be..ac12ee53a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,6 +79,7 @@
<module>examples/org.eclipse.swt.examples.launcher</module>
<module>examples/org.eclipse.swt.examples.ole.win32</module>
<module>examples/org.eclipse.swt.examples.views</module>
+ <module>tests/org.eclipse.swt.tests.fragments.feature</module>
<module>tests/org.eclipse.swt.tests</module>
<module>features/org.eclipse.swt.tools.feature</module>
</modules>
diff --git a/tests/org.eclipse.swt.tests.fragments.feature/.project b/tests/org.eclipse.swt.tests.fragments.feature/.project
new file mode 100644
index 0000000000..8623121a45
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.fragments.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.swt.tools.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.swt.tests.fragments.feature/build.properties b/tests/org.eclipse.swt.tests.fragments.feature/build.properties
new file mode 100644
index 0000000000..a8f7a169b7
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.fragments.feature/build.properties
@@ -0,0 +1,13 @@
+############################################################################
+# Copyright (c) 2010, 2014 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
+###############################################################################
+bin.includes =\
+feature.xml,\
+feature.properties \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.fragments.feature/feature.properties b/tests/org.eclipse.swt.tests.fragments.feature/feature.properties
new file mode 100644
index 0000000000..f450bb9934
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.fragments.feature/feature.properties
@@ -0,0 +1,24 @@
+###############################################################################
+# Copyright (c) 2014, 2016 Red Hat Inc. 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:
+# Alexander Kurtakov <akurtako@redhat.com> - initial API and implementation
+###############################################################################
+featureName=SWT Tools
+description=SWT Tools, including Sleak, SWT Spy Plugin, and JniGen.
+descriptionURL=https://www.eclipse.org/swt/tools/
+providerName=Eclipse.org
+
+copyright=\
+Copyright (c) 2014, 2016 Red Hat Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+ Red Hat Inc. - initial API and implementation\n
diff --git a/tests/org.eclipse.swt.tests.fragments.feature/feature.xml b/tests/org.eclipse.swt.tests.fragments.feature/feature.xml
new file mode 100644
index 0000000000..e34bd5d137
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.fragments.feature/feature.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.swt.tests.fragments.feature"
+ label="%featureName"
+ version="3.106.0.qualifier"
+ provider-name="%providerName"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description url="%descriptionURL">
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.eclipse.swt.gtk.linux.x86"
+ os="linux"
+ ws="gtk"
+ arch="x86"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.gtk.linux.x86_64"
+ os="linux"
+ ws="gtk"
+ arch="x86_64"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.gtk.linux.ppc"
+ os="linux"
+ ws="gtk"
+ arch="ppc"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.gtk.linux.ppc64"
+ os="linux"
+ ws="gtk"
+ arch="ppc64"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.gtk.linux.ppc64le"
+ os="linux"
+ ws="gtk"
+ arch="ppc64le"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.win32.win32.x86_64"
+ os="win32"
+ ws="win32"
+ arch="x86_64"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.win32.win32.x86"
+ os="win32"
+ ws="win32"
+ arch="x86"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.cocoa.macosx.x86_64"
+ os="macosx"
+ ws="cocoa"
+ arch="x86_64"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+</feature>
diff --git a/tests/org.eclipse.swt.tests.fragments.feature/pom.xml b/tests/org.eclipse.swt.tests.fragments.feature/pom.xml
new file mode 100644
index 0000000000..c06d57ae11
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.fragments.feature/pom.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2014 Red Hat Inc. and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Distribution License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/org/documents/edl-v10.php
+
+ Contributors:
+ Alexander Kurtakov <akurtako@redhat.com> - initial implementation
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>eclipse.platform.swt</artifactId>
+ <groupId>eclipse.platform.swt</groupId>
+ <version>4.7.0-SNAPSHOT</version>
+ <relativePath>../../</relativePath>
+ </parent>
+ <groupId>org.eclipse.swt.tests</groupId>
+ <artifactId>org.eclipse.swt.tests.fragments.feature</artifactId>
+ <version>3.106.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
diff --git a/tests/org.eclipse.swt.tests/pom.xml b/tests/org.eclipse.swt.tests/pom.xml
index d441b14680..7bfd3c2789 100644
--- a/tests/org.eclipse.swt.tests/pom.xml
+++ b/tests/org.eclipse.swt.tests/pom.xml
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -23,17 +23,58 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
<code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>
+ <argLine>-Dorg.eclipse.swt.internal.gtk.disablePrinting -Dorg.eclipse.swt.browser.DefaultType=webkit</argLine>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <configuration>
+ <!-- Make all platform-specific fragments available (and optional) via a feature -->
+ <dependency-resolution>
+ <extraRequirements>
+ <requirement>
+ <type>eclipse-feature</type>
+ <id>org.eclipse.swt.tests.fragments.feature</id>
+ <versionRange>0.0.0</versionRange>
+ </requirement>
+ </extraRequirements>
+ </dependency-resolution>
+ <!-- but only resolve against current environment as we don't want all fragments simultaneously in test -->
+ <environments combine.self="override"/> <!-- we only want platform specific artifacts here -->
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.swt.tests</testSuite>
- <testClass>org.eclipse.swt.tests.junit.AllTests</testClass>
+ <skipTests>true</skipTests> <!-- Use maven surefire -->
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <executions>
+ <execution>
+ <id>test</id>
+ <goals><goal>test</goal></goals>
+ <phase>integration-test</phase>
+ <configuration>
+ <test>AllTests</test>
+ <testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-junit47</artifactId>
+ <version>2.19.1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
</project>

Back to the top