eclipse/eclipse-test-support.patch

279 lines
10 KiB
Diff
Raw Normal View History

2012-12-19 17:47:29 +00:00
--- eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/test.xml.orig 2012-12-17 15:03:11.000000000 +0100
+++ eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/test.xml 2012-12-18 11:08:09.033309587 +0100
@@ -164,98 +164,14 @@
<!--use an stable version of the director so that instability in the current build doesn't cause all the tests to fail -->
<target name="setupPlatform">
<echo message="os.arch ${os.arch}" />
- <property file="equinoxp2tests.properties" />
- <condition
- property="platformArchive"
- value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.linux}">
- <and>
- <os family="unix" />
- <not>
- <or>
- <or>
- <os arch="x86_64" />
- <os arch="amd64" />
- </or>
- <os family="mac" />
- </or>
- </not>
- </and>
- </condition>
- <condition
- property="platformArchive"
- value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.macosx-x86_64}">
- <and>
- <os family="mac" />
- <os family="unix" />
- <or>
- <os arch="x86_64" />
- <os arch="amd64" />
- </or>
- </and>
- </condition>
- <condition
- property="platformArchive"
- value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.macosx}">
- <and>
- <os family="mac" />
- <os family="unix" />
- <!-- should not need, as long as x86_64 rules (above) comes first
- <os arch="i386" />
- -->
- </and>
- </condition>
- <condition
- property="platformArchive"
- value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.win32}">
- <and>
- <os family="windows" />
- <os arch="x86" />
- </and>
- </condition>
- <condition
- property="platformArchive"
- value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.win32-x86_64}">
- <and>
- <os family="windows" />
- <or>
- <os arch="x86_64" />
- <os arch="amd64" />
- </or>
- </and>
- </condition>
- <condition
- property="platformArchive"
- value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.linux-x86_64}">
- <and>
- <os family="unix" />
- <or>
- <os arch="x86_64" />
- <os arch="amd64" />
- </or>
- </and>
- </condition>
-
- <fail
- unless="platformArchive"
- message="platformArchive is not defined. Check that condidtions cover os arch ${os.arch}. May be VM dependent.)" />
-
- <condition
- property="platformTarget"
- value="platform-zip">
- <contains
- string="${platformArchive}"
- substring=".zip" />
+ <property name="platformArchive" value="${runtimeArchive}" />
+
+ <condition property="platformTarget" value="platform-zip">
+ <contains string="${platformArchive}" substring=".zip" />
2012-12-19 17:47:29 +00:00
</condition>
- <condition
- property="platformTarget"
- value="platform-tar.gz">
- <contains
- string="${platformArchive}"
- substring=".tar.gz" />
+ <condition property="platformTarget" value="platform-tar.gz">
+ <contains string="${platformArchive}" substring=".tar.gz" />
2012-12-19 17:47:29 +00:00
</condition>
- <fail
- unless="platformTarget"
- message="platformTarget is not defined. Check that platformArchive variable and value is defined correctly, such as in equinoxp2tests.properties in the appropriate testConfig" />
<echo message="platformTarget ${platformTarget} platformArchive ${platformArchive}" />
<antcall target="${platformTarget}" />
</target>
@@ -283,7 +199,7 @@
<exec
dir="${platformLocation}"
executable="tar">
- <arg line="-xzf ${platformArchive}" />
+ <arg line="-xzf ../${platformArchive}" />
</exec>
</target>
@@ -815,6 +731,17 @@
arg2="" />
</not>
</condition>
+
+ <!-- swt needs this property to run tests -->
+ <dirset id="test.plugin.folder" dir="${eclipse-home}/plugins/">
+ <include name="${testPlugin}_*" />
+ </dirset>
+ <property name="testPluginFolder" refid="test.plugin.folder" />
+ <echo>trying to find ${testPluginFolder}</echo>
+ <condition property="org.eclipse.swt.tests" value="${testPluginFolder}">
+ <equals arg1="${testPlugin}" arg2="org.eclipse.swt.tests"/>
+ </condition>
2012-12-19 17:47:29 +00:00
+
<antcall target="runSuite" />
<antcall target="genResults" />
</target>
@@ -1252,7 +1179,7 @@
<target name="all">
- <antcall target="markCurrentTime">
+ <!-- antcall target="markCurrentTime">
<param
name="message"
value="start relEng" />
@@ -1262,7 +1189,7 @@
<param
name="message"
value="end relEng" />
- </antcall>
+ </antcall -->
2012-12-19 17:47:29 +00:00
<antcall target="markCurrentTime">
<param
@@ -1374,7 +1301,7 @@
hang, during performance testss
-->
<target name="platformLR">
- <antcall target="teamcvs" />
+ <!-- antcall target="teamcvs" / -->
<antcall target="jface" />
<antcall target="swt" />
<antcall target="uiperformance" />
--- eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/runtests.sh.orig 2012-12-17 15:03:11.000000000 +0100
+++ eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/runtests.sh 2012-12-18 11:21:53.867638480 +0100
@@ -1,5 +1,74 @@
#!/usr/bin/env bash
2012-12-19 17:47:29 +00:00
+
+function findXvncAndSetDisplay() {
+# if [ ${headless} == 1 ]; then
+ # Try to find Xvnc
+ xvnc=
+ if [ -a /usr/bin/Xvnc ]
+ then
+ xvnc=/usr/bin/Xvnc
+ setupXvnc
+ else
+ if [ -a /usr/X11/bin/Xvnc ]
+ then
+ xvnc=/usr/X11/bin/Xvnc
+ setupXvnc
+ else
+ echo "Couldn't find Xvnc (/usr/bin/Xvnc or /usr/X11/bin/Xvnc). Using DISPLAY=0:0"
+ DISPLAY=`$HOST`:0.0
+ fi
+ fi
+ export DISPLAY
+# fi
+}
+
+function setupXvnc() {
+ # Pick a high display number.
+ port=`expr '(' $RANDOM '*' 9 / 32767 ')' + 58`
+ echo localhost > Xvnc.cfg
+ echo "Setting up Xvnc on port ${port} with password VNCpassword1"
+ $xvnc :$port -screen 1 1024x768x32 -auth Xvnc.cfg -localhost -PasswordFile eclipse-tests-vncpwd &> Xvnc.log &
+ Xvncpid=$!
+ DISPLAY=`$HOST`:$port
+}
+
+function setArch() {
+ if [ "x$buildArch" = "x" ]
+ then
+ if uname -m > /dev/null 2>&1; then
+ arch=`uname -m`
+ else
+ arch=`uname -p`
+ fi
+ # Massage arch for Eclipse-uname differences
+ case $arch in
+ i[0-9]*86)
+ arch=x86 ;;
+ ia64)
+ arch=ia64 ;;
+ ppc)
+ arch=ppc ;;
+ x86_64)
+ arch=x86_64 ;;
+ *)
+ echo "Unrecognized architecture: $arch" 1>&2
+ exit 1 ;;
+ esac
+ echo >&2 "Architecture not specified. Assuming host architecture: $arch"
+ fi
+}
+
+function cleanupXvnc() {
+ # Clean up if we used Xvnc
+ if [ -e Xvnc.cfg ]
+ then
+ kill $Xvncpid
+ rm Xvnc.cfg
+ fi
+}
2012-12-19 17:47:29 +00:00
+
+
# 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,11 +161,18 @@
#necessary when invoking this script through rsh
cd $dir
2012-12-19 17:47:29 +00:00
+
+ mkdir -p /tmp/eclipse-tests-directory
+ pushd /tmp/eclipse-tests-directory
+ rm -rf *
+
if [ ! -r eclipse ]
then
- tar -xzf eclipse-SDK-*.tar.gz
- # note, the file pattern to match, must not start with */plugins because there is no leading '/' in the zip file, since they are repos.
- unzip -qq -o -C eclipse-junit-tests-*.zip plugins/org.eclipse.test* -d eclipse/dropins/
+ pushd @libdir@
2012-12-19 17:47:29 +00:00
+ tar czf /tmp/eclipse-tests-directory/eclipse-SDK-v20120903-1347-linux-gtk-x86_64.tar.gz eclipse
+ popd
+ cp -rf @libdir@/eclipse eclipse
+ unzip -o -C /usr/share/java/eclipse-tests/eclipse-junit-tests-*.zip */plugins/org.eclipse.test* -d eclipse/dropins/
2012-12-19 17:47:29 +00:00
fi
2012-12-19 17:47:29 +00:00
# run tests
@@ -139,9 +215,15 @@
echo "extdirproperty in runtest: ${extdirproperty}"
2012-12-19 17:47:29 +00:00
# -Dtimeout=300000 "${ANT_OPTS}"
+
+ if [[ ! -z "${testslocation}" ]]
+ then
+ testslocation="/usr/share/java/eclipse-tests/"
+fi
+
if [[ ! -z "${extdirproperty}" ]]
then
- $vmcmd "${extdirproperty}" -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
+ $vmcmd "${extdirproperty}" -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${testslocation}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
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
+ $vmcmd -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${testslocation}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
fi