Blame SOURCES/eclipse-test-support.patch

10f0d1
--- eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/test.xml.orig	2014-04-01 15:02:34.500445944 +0100
10f0d1
+++ eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/test.xml	2014-04-01 15:16:01.556714647 +0100
066e0a
@@ -24,13 +24,6 @@
066e0a
     has to move to "top of file" ... outer scope?
066e0a
    <property file="${eclipseBuilderDir}/eclipse/buildConfigs/sdk.tests/testConfigs/${testPlatform}/testing.properties" />
066e0a
 -->
066e0a
-  
066e0a
-    name="testingPropertiesfile"
066e0a
-    value="testing.properties" />
066e0a
-  <loadproperties>
066e0a
-    <file file="${testingPropertiesfile}" />
066e0a
-  </loadproperties>
066e0a
-
066e0a
066e0a
   
066e0a
   
10f0d1
@@ -200,99 +200,14 @@
10f0d1
 
10f0d1
   
10f0d1
   <target name="setupPlatform">
10f0d1
-    <echo message="os.arch ${os.arch}" />
10f0d1
     <loadproperties srcfile="equinoxp2tests.properties" />
10f0d1
-    
10f0d1
-      property="platformArchive"
10f0d1
-      value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.linux}">
10f0d1
-      <and>
10f0d1
-        <os family="unix" />
10f0d1
-        <not>
10f0d1
-          <or>
10f0d1
-            <or>
10f0d1
-              <os arch="x86_64" />
10f0d1
-              <os arch="amd64" />
10f0d1
-            </or>
10f0d1
-            <os family="mac" />
10f0d1
-          </or>
10f0d1
-        </not>
10f0d1
-      </and>
10f0d1
-    </condition>
10f0d1
-    
10f0d1
-      property="platformArchive"
10f0d1
-      value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.macosx-x86_64}">
10f0d1
-      <and>
10f0d1
-        <os family="mac" />
10f0d1
-        <os family="unix" />
10f0d1
-        <or>
10f0d1
-          <os arch="x86_64" />
10f0d1
-          <os arch="amd64" />
10f0d1
-        </or>
10f0d1
-      </and>
10f0d1
-    </condition>
10f0d1
-    
10f0d1
-      property="platformArchive"
10f0d1
-      value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.macosx}">
10f0d1
-      <and>
10f0d1
-        <os family="mac" />
10f0d1
-        <os family="unix" />
10f0d1
-        
10f0d1
-             <os arch="i386" />
10f0d1
-        -->
10f0d1
-      </and>
10f0d1
-    </condition>
10f0d1
-    
10f0d1
-      property="platformArchive"
10f0d1
-      value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.win32}">
10f0d1
-      <and>
10f0d1
-        <os family="windows" />
10f0d1
-        <os arch="x86" />
10f0d1
-      </and>
10f0d1
-    </condition>
10f0d1
-    
10f0d1
-      property="platformArchive"
10f0d1
-      value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.win32-x86_64}">
10f0d1
-      <and>
10f0d1
-        <os family="windows" />
10f0d1
-        <or>
10f0d1
-          <os arch="x86_64" />
10f0d1
-          <os arch="amd64" />
10f0d1
-        </or>
10f0d1
-      </and>
10f0d1
-    </condition>
10f0d1
-    
10f0d1
-      property="platformArchive"
10f0d1
-      value="${org.eclipse.equinox.p2.reconciler.tests.lastrelease.platform.archive.linux-x86_64}">
10f0d1
-      <and>
10f0d1
-        <os family="unix" />
10f0d1
-        <or>
10f0d1
-          <os arch="x86_64" />
10f0d1
-          <os arch="amd64" />
10f0d1
-        </or>
10f0d1
-      </and>
10f0d1
+    <property name="platformArchive" value="${runtimeArchive}" />
10f0d1
+    <condition property="platformTarget" value="platform-zip">
10f0d1
+      <contains string="${platformArchive}" substring=".zip" />
10f0d1
     </condition>
10f0d1
-
10f0d1
-    
10f0d1
-      unless="platformArchive"
10f0d1
-      message="platformArchive is not defined. Check that conditions cover os arch ${os.arch}. May be VM dependent.)" />
10f0d1
-
10f0d1
-    
10f0d1
-      property="platformTarget"
10f0d1
-      value="platform-zip">
10f0d1
-      
10f0d1
-        string="${platformArchive}"
10f0d1
-        substring=".zip" />
10f0d1
-    </condition>
10f0d1
-    
10f0d1
-      property="platformTarget"
10f0d1
-      value="platform-tar.gz">
10f0d1
-      
10f0d1
-        string="${platformArchive}"
10f0d1
-        substring=".tar.gz" />
10f0d1
+    <condition property="platformTarget" value="platform-tar.gz">
10f0d1
+      <contains string="${platformArchive}" substring=".tar.gz" />
10f0d1
     </condition>
10f0d1
-    
10f0d1
-      unless="platformTarget"
10f0d1
-      message="platformTarget is not defined. Check that platformArchive variable and value is defined correctly, such as in equinoxp2tests.properties in the appropriate testConfig" />
10f0d1
     <echo message="platformTarget ${platformTarget} platformArchive ${platformArchive}" />
10f0d1
     <antcall target="${platformTarget}" />
10f0d1
   </target>
10f0d1
@@ -320,7 +235,7 @@
10f0d1
     
10f0d1
       dir="${platformLocation}"
10f0d1
       executable="tar">
10f0d1
-      <arg line="-xzf ${platformArchive}" />
10f0d1
+      <arg line="-xzf ../${platformArchive}" />
10f0d1
     </exec>
10f0d1
   </target>
10f0d1
 
10f0d1
@@ -867,6 +782,17 @@
10f0d1
           arg2="" />
10f0d1
       </not>
10f0d1
     </condition>
10f0d1
+
10f0d1
+    
10f0d1
+    <dirset id="test.plugin.folder" dir="${eclipse-home}/plugins/">
10f0d1
+      <include name="${testPlugin}_*" />
10f0d1
+    </dirset>
10f0d1
+    <property name="testPluginFolder" refid="test.plugin.folder" />
10f0d1
+    <echo>trying to find ${testPluginFolder}</echo>
10f0d1
+    <condition property="org.eclipse.swt.tests" value="${testPluginFolder}">
10f0d1
+      <equals arg1="${testPlugin}" arg2="org.eclipse.swt.tests"/>
10f0d1
+    </condition>
10f0d1
+
10f0d1
     <antcall target="runSuite" />
10f0d1
     <antcall target="genResults" />
10f0d1
   </target>
10f0d1
@@ -1411,6 +1337,15 @@
10f0d1
         value="end longRunningTests" />
10f0d1
     </antcall>
10f0d1
 
10f0d1
+    
10f0d1
+    <mkdir dir="${results}/origXml" />
10f0d1
+    <xslt style="${repoLocation}/splitter.xsl" basedir="${results}/xml" includes="*.xml" destdir="${results}/origXml"/>
10f0d1
+    
10f0d1
+    <junitreport todir="${results}/xml" tofile="org.eclipse.sdk.tests.xml">
10f0d1
+      <fileset dir="${results}/origXml" includes="*.xml" />
10f0d1
+    </junitreport>
10f0d1
+    
10f0d1
+    <xslt style="${repoLocation}/JUNIT.XSL" basedir="${results}/xml" includes="org.eclipse.sdk.tests.xml" destdir="${results}/html" />
10f0d1
   </target>
10f0d1
 
10f0d1
   
10f0d1
@@ -1453,7 +1388,6 @@
10f0d1
     <antcall target="e4CssSwt" />
10f0d1
     <antcall target="e4UI" />
10f0d1
     <antcall target="equinoxds" />
10f0d1
-    <antcall target="equinoxp2discovery" />
10f0d1
     <antcall target="bidi" />
10f0d1
     <antcall target="ltkuirefactoringtests" />
10f0d1
     <antcall target="ltkcorerefactoringtests" />
10f0d1
@@ -1467,7 +1401,6 @@
10f0d1
     <antcall target="osgi" />
10f0d1
     <antcall target="coreresources" />
10f0d1
     <antcall target="equinoxp2" />
10f0d1
-    <antcall target="teamcvs" />
10f0d1
     <antcall target="jface" />
10f0d1
     <antcall target="ui" />
10f0d1
     <antcall target="uiperformance" />
10f0d1
@@ -1550,7 +1483,7 @@
10f0d1
     
10f0d1
       name="message"
10f0d1
       value="no message given by caller" />
10f0d1
-    <markTime msg="${message}" />
10f0d1
+    
10f0d1
   </target>
10f0d1
 
10f0d1
   
10f0d1
--- eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/runtests.sh.orig	2014-05-26 17:04:22.000000000 +0300
10f0d1
+++ eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/runtests.sh	2014-05-26 19:17:46.622004452 +0300
10f0d1
@@ -1,5 +1,72 @@
10f0d1
 #!/usr/bin/env bash
10f0d1
 
10f0d1
+function findXvncAndSetDisplay() {
10f0d1
+#   if [ ${headless} == 1 ]; then
10f0d1
+        # Try to find Xvnc
10f0d1
+        xvnc=
10f0d1
+        if [ -a /usr/bin/Xvnc ]
10f0d1
+        then
10f0d1
+            xvnc=/usr/bin/Xvnc
10f0d1
+            setupXvnc
10f0d1
+        else
10f0d1
+            if [ -a /usr/X11/bin/Xvnc ]
10f0d1
+            then
10f0d1
+                xvnc=/usr/X11/bin/Xvnc
10f0d1
+                setupXvnc
10f0d1
+            else
10f0d1
+                echo "Couldn't find Xvnc (/usr/bin/Xvnc or /usr/X11/bin/Xvnc).  Using DISPLAY=0:0"
10f0d1
+                DISPLAY=`$HOST`:0.0
10f0d1
+            fi
10f0d1
+        fi
10f0d1
+        export DISPLAY
10f0d1
+#   fi
10f0d1
+}
10f0d1
+
10f0d1
+function setupXvnc() {
10f0d1
+    # Pick a high display number.
10f0d1
+    port=`expr '(' $RANDOM '*' 9 / 32767 ')' + 58`
10f0d1
+    echo localhost > Xvnc.cfg
10f0d1
+    echo "Setting up Xvnc on port ${port} with password VNCpassword1"
10f0d1
+    $xvnc :$port -screen 1 1024x768x32 -auth Xvnc.cfg -localhost -PasswordFile eclipse-tests-vncpwd &> Xvnc.log &
10f0d1
+    Xvncpid=$!
10f0d1
+    DISPLAY=`$HOST`:$port
10f0d1
+}
10f0d1
+
10f0d1
+function setArch() {
10f0d1
+    if [ "x$buildArch" = "x" ]
10f0d1
+    then
10f0d1
+        if uname -m > /dev/null 2>&1; then
10f0d1
+            arch=`uname -m`
10f0d1
+        else
10f0d1
+            arch=`uname -p`
10f0d1
+        fi
10f0d1
+        # Massage arch for Eclipse-uname differences
10f0d1
+        case $arch in
10f0d1
+            i[0-9]*86)
10f0d1
+                arch=x86 ;;
10f0d1
+            ia64)
10f0d1
+                arch=ia64 ;;
10f0d1
+            ppc)
10f0d1
+                arch=ppc ;;
10f0d1
+            x86_64)
10f0d1
+                arch=x86_64 ;;
10f0d1
+            *)
10f0d1
+                echo "Unrecognized architecture:  $arch" 1>&2
10f0d1
+                exit 1 ;;
10f0d1
+        esac
10f0d1
+        echo >&2 "Architecture not specified.  Assuming host architecture: $arch"
10f0d1
+    fi
10f0d1
+}
10f0d1
+
10f0d1
+function cleanupXvnc() {
10f0d1
+    # Clean up if we used Xvnc
10f0d1
+    if [ -e Xvnc.cfg ]
10f0d1
+    then
10f0d1
+        kill $Xvncpid
10f0d1
+        rm Xvnc.cfg
10f0d1
+    fi
10f0d1
+}
10f0d1
+
10f0d1
 # This file should never exist or be needed for production machine,
10f0d1
 # but allows an easy way for a "local user" to provide this file
10f0d1
 # somewhere on the search path ($HOME/bin is common),
10f0d1
@@ -92,59 +159,31 @@ fi
10f0d1
 #necessary when invoking this script through rsh
10f0d1
 cd $dir
10f0d1
 
10f0d1
+    mkdir -p /tmp/eclipse-tests-directory
10f0d1
+    pushd /tmp/eclipse-tests-directory
10f0d1
+    rm -rf *
10f0d1
+    cp ${testslocation}/*.properties .
10f0d1
+    cp ${testslocation}/library.xml .
10f0d1
+
10f0d1
 if [ ! -r eclipse ]
10f0d1
 then
10f0d1
-  tar -xzf eclipse-SDK-*.tar.gz
10f0d1
-  # note, the file pattern to match, must not start with */plugins because there is no leading '/' in the zip file, since they are repos.
10f0d1
-  unzip -qq -o -C eclipse-junit-tests-*.zip plugins/org.eclipse.test* -d eclipse/dropins/
10f0d1
+  pushd @libdir@
10f0d1
+    tar czf /tmp/eclipse-tests-directory/eclipse-SDK-temp-linux-gtk-x86_64.tar.gz eclipse
10f0d1
+  popd
10f0d1
+  cp -rf @libdir@/eclipse eclipse
10f0d1
 fi
10f0d1
 
10f0d1
 # run tests
10f0d1
 launcher=`ls eclipse/plugins/org.eclipse.equinox.launcher_*.jar`
10f0d1
+findXvncAndSetDisplay
10f0d1
+setArch
10f0d1
+export ANT_HOME=@USR@/share/ant
10f0d1
+@USR@/bin/./ant \
10f0d1
+-file "${testslocation}/test.xml" $tests \
10f0d1
+-Dws=$ws -Dos=$os -Darch=$arch -Dos.arch=$arch \
10f0d1
+-DbuildId=v20120903-1347 -Dbasedir="/tmp/eclipse-tests-directory" \
10f0d1
+-DruntimeArchive="eclipse-SDK-temp-linux-gtk-x86_64.tar.gz" \
10f0d1
+-DrepoLocation="${testslocation}" \
10f0d1
+-Dorg.eclipse.test="3.3.100" \
10f0d1
+-D$installmode=true $properties
10f0d1
 
10f0d1
-echo " = = = Start list environment variables in effect = = = ="
10f0d1
-env
10f0d1
-echo " = = = End list environment variables in effect = = = ="
10f0d1
-
10f0d1
-# make sure there is a window manager running. See bug 379026
10f0d1
-# we should not have to, but may be a quirk/bug of hudson setup
10f0d1
-# assuming metacity attaches to "current" display by default (which should have
10f0d1
-# already been set by Hudson). We echo its value here just for extra reference/cross-checks.
10f0d1
-
066e0a
-echo "Check if any window managers are running (xfwm|twm|metacity|beryl|fluxbox|compiz|kwin|openbox|icewm):"
066e0a
-wmpss=$(ps -ef | egrep -i "xfwm|twm|metacity|beryl|fluxbox|compiz|kwin|openbox|icewm" | grep -v egrep)
10f0d1
-echo "Window Manager processes: $wmpss"
10f0d1
-echo
10f0d1
-
10f0d1
-if [[ -z $wmpss ]]
10f0d1
-then
10f0d1
-  echo "No window managers processes found running, so will start metacity"
10f0d1
-  metacity --replace --sm-disable  &
10f0d1
-  METACITYPID=$!
10f0d1
-  echo $METACITYPID > epmetacity.pid
10f0d1
-else
10f0d1
-  echo "Existing window manager found running, so did not force start of metacity"
10f0d1
-fi
10f0d1
-
10f0d1
-echo
10f0d1
-
10f0d1
-# list out metacity processes so overtime we can see if they accumulate, or if killed automatically
10f0d1
-# when our process exits. If not automatic, should use epmetacity.pid to kill it when we are done.
10f0d1
-echo "Current metacity processes running (check for accumulation):"
10f0d1
-ps -ef | grep "metacity" | grep -v grep
10f0d1
-echo
10f0d1
-
10f0d1
-echo "Triple check if any window managers are running (at least metacity should be!):"
066e0a
-wmpss=$(ps -ef | egrep -i "xfwm|twm|metacity|beryl|fluxbox|compiz|kwin|openbox|icewm" | grep -v egrep)
10f0d1
-echo "Window Manager processes: $wmpss"
10f0d1
-echo
10f0d1
-echo "extdirprop in runtest: ${extdirprop}"
10f0d1
-echo "extdirproperty in runtest: ${extdirproperty}"
10f0d1
-
10f0d1
-# -Dtimeout=300000 "${ANT_OPTS}"
10f0d1
-if [[ ! -z "${extdirproperty}" ]]
10f0d1
-then
10f0d1
-  $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
10f0d1
-else
10f0d1
-  $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
10f0d1
-fi