Fix failure to run tests and backport patch for ebz#489953 in order to fix

some unit tests
This commit is contained in:
Mat Booth 2016-03-24 18:49:34 +00:00
parent d96d2db4a8
commit 467bdc5dca
4 changed files with 133 additions and 14 deletions

63
eclipse-bug-489953.patch Normal file
View File

@ -0,0 +1,63 @@
From bd2e4b64ecd5e5b0d476810cc1d365ce8f3065c5 Mon Sep 17 00:00:00 2001
From: Eric Williams
Date: Fri, 18 Mar 2016 11:45:13 -0400
Subject: Bug 489953: [GTK3.14-] Button background tests fail
GTK3.14 and below does not have access to CSS parsing methods. There are
however a handful of widgets that use CSS background colors on GTK3.14.
Button is one of these, as CSS theming was introduced to Button to fix
some bugs.
This means that on GTK3.14 there is a test failure for
Button.getBackground() since SWT cannot parse GTK CSS on GTK3.14. The
solution to keep track of the background color and override
getContextBackground() in Button. This eliminates the last failing color
test case on GTK3.14
This modifies behavior for GTK3.14 and below. GTK3.16 behavior is
unaffected as CSS parsing machinery exists for 3.16 and up.
Tested on GTK3.18, 3.16, 3.14, and 2.24. AllNonBrowserTests pass on GTK3
and GTK2.---
.../Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 967550c..9aab8be 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -50,6 +50,7 @@ public class Button extends Control {
ImageList imageList;
Image image;
String text;
+ GdkRGBA background;
static final int INNER_BORDER = 1;
static final int DEFAULT_BORDER = 1;
@@ -127,6 +128,14 @@ static GtkBorder getBorder (byte[] border, long /*int*/ handle, int defaultBorde
return gtkBorder;
}
+@Override
+GdkColor getContextBackground () {
+ if (background != null) {
+ return display.toGdkColor (background);
+ }
+ return display.COLOR_WIDGET_BACKGROUND;
+}
+
/**
* Adds the listener to the collection of listeners who will
* be notified when the control is selected by the user, by sending
@@ -799,6 +808,7 @@ void _setAlignment (int alignment) {
void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) {
/* Note: this function is called on Gtk3 only */
+ background = rgba;
//Pre Gtk 3.10 doesn't handle CSS background color very well for Gtk Check/Radio button.
// 3.10.3 as it was the latest to affect themeing in button.
if (OS.GTK_VERSION < OS.VERSION(3, 10, 3) && (style & (SWT.CHECK | SWT.RADIO)) != 0) {
--
cgit v0.11.2-4-g4a35

View File

@ -113,3 +113,15 @@ index bc8963d..fbe4da3 100644
+jars.compile.order = lib/apttestprocessors.jar,\
+ lib/apttestprocessors8.jar,\
+ .
--- eclipse.platform/ant/org.eclipse.ant.tests.ui/build.properties.orig 2016-03-24 14:25:47.076289150 +0000
+++ eclipse.platform/ant/org.eclipse.ant.tests.ui/build.properties 2016-03-24 14:26:39.528660802 +0000
@@ -25,6 +25,8 @@
Ant Tests/
source.lib/antUITestsSupport.jar = test support/
-jars.compile.order=anttestsui.jar,lib/antUITestsSupport.jar
+source.testbuildfiles/antUITestsSupport.jar = test support/
+jars.compile.order=anttestsui.jar,lib/antUITestsSupport.jar,testbuildfiles/antUITestsSupport.jar
output.lib/antUITestsSupport.jar = test_support_bin/
+output.testbuildfiles/antUITestsSupport.jar = test_support_bin/
output.anttestsui.jar = bin/

View File

@ -238,7 +238,43 @@
# This file should never exist or be needed for production machine,
# but allows an easy way for a "local user" to provide this file
# somewhere on the search path ($HOME/bin is common),
@@ -92,59 +159,31 @@ fi
@@ -32,35 +99,6 @@
fi
echo "jvm: $jvm"
-# On production, WORKSPACE is the 'hudson' workspace.
-# But, if running standalone, we'll assume "up two" from current directoy
-WORKSPACE=${WORKSPACE:-"../../.."};
-
-stableEclipseSDK=${stableEclipseSDK:-eclipse-SDK-4.5.1-linux-gtk-x86_64.tar.gz}
-stableEclipseInstallLocation=${stableEclipseInstallLocation:-${WORKSPACE}/org.eclipse.releng.basebuilder}
-
-# Note: test.xml will "reinstall" fresh install of what we are testing,
-# but we do need an install for initial launcher, and, later, need one for a
-# stable version of p2 director. For both purposes, we
-# we should use "old and stable" version,
-# which needs to be installed in ${stableEclipseInstallLocation}.
-# Note: for production tests, we use ${WORKSPACE}/org.eclipse.releng.basebuilder,
-# for historical reasons. The "true" (old) basebuilder does not have an 'eclipse' directory;
-# plugins is directly under org.eclipse.releng.basebuilder.
-if [[ ! -r ${stableEclipseInstallLocation} || ! -r "${stableEclipseInstallLocation}/eclipse" ]]
-then
- mkdir -p ${stableEclipseInstallLocation}
- tar -xf ${stableEclipseSDK} -C ${stableEclipseInstallLocation}
-fi
-
-launcher=$(find ${stableEclipseInstallLocation} -name "org.eclipse.equinox.launcher_*.jar" )
-if [ -z "${launcher}" ]
-then
- echo "ERROR: launcher not found in ${stableEclipseInstallLocation}"
- exit 1
-fi
-echo "launcher: $launcher"
-
# define, but null out variables we expect on the command line
# operating system, windowing system and architecture variables
os=
@@ -135,59 +173,37 @@
#necessary when invoking this script through rsh
cd $dir
@ -262,21 +298,14 @@
# run tests
launcher=`ls eclipse/plugins/org.eclipse.equinox.launcher_*.jar`
+findXvncAndSetDisplay
+export JAVA_HOME=/usr/lib/jvm/java-1.8.0/jre
+setArch
+export ANT_HOME=@USR@/share/ant
+@USR@/bin/./ant \
+-file "${testslocation}/test.xml" $tests \
+-Dws=$ws -Dos=$os -Darch=$arch -Dos.arch=$arch \
+-DbuildId=v20120903-1347 -Dbasedir="/tmp/eclipse-tests-directory" \
+-DruntimeArchive="eclipse-SDK-temp-linux-gtk-x86_64.tar.gz" \
+-DrepoLocation="${testslocation}" \
+-Dorg.eclipse.test="3.3.100" \
+-D$installmode=true $properties
-echo " = = = Start list environment variables in effect = = = ="
-env
-echo " = = = End list environment variables in effect = = = ="
-
echo " = = = Start list environment variables in effect = = = ="
env
echo " = = = End list environment variables in effect = = = ="
-# make sure there is a window manager running. See bug 379026
-# we should not have to, but may be a quirk/bug of hudson setup
-# assuming metacity attaches to "current" display by default (which should have
@ -319,6 +348,15 @@
-else
- $vmcmd -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
-fi
+@USR@/bin/./ant \
+-file "${testslocation}/test.xml" $tests \
+-Dws=$ws -Dos=$os -Darch=$arch -Dos.arch=$arch \
+-DbuildId=v20120903-1347 -Dbasedir="/tmp/eclipse-tests-directory" \
+-DruntimeArchive="eclipse-SDK-temp-linux-gtk-x86_64.tar.gz" \
+-DrepoLocation="${testslocation}" \
+-Dorg.eclipse.test="3.3.200" \
+-D$installmode=true $properties
+
--- eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/test.xml.orig 2016-02-17 00:50:39.910394827 +0000
+++ eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/test.xml 2016-02-17 00:54:04.625884958 +0000
@@ -169,7 +169,9 @@

View File

@ -49,7 +49,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_version}
Release: 5%{?dist}
Release: 6%{?dist}
License: EPL
URL: http://www.eclipse.org/
@ -148,6 +148,7 @@ Patch34: eclipse-bug-484696.patch
Patch35: eclipse-bug-477487.patch
Patch36: eclipse-bug-487712.patch
Patch37: eclipse-bug-488226.patch
Patch38: eclipse-bug-489953.patch
BuildRequires: rsync
BuildRequires: make, gcc
@ -404,6 +405,7 @@ popd
%patch36 -p1
pushd eclipse.platform.swt
%patch37 -p1
%patch38 -p1
popd
# Resolving the target platform requires too many changes, so don't use it
@ -1136,6 +1138,10 @@ fi
%{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_*
%changelog
* Thu Mar 24 2016 Mat Booth <mat.booth@redhat.com> - 1:4.5.2-6
- Fix failure to run tests and backport patch for ebz#489953 in order to fix
some unit tests
* Wed Mar 16 2016 Mat Booth <mat.booth@redhat.com> - 1:4.5.2-5
- Rebuild for ECF and disable the build of some bundles that are not shipped