Blob Blame History Raw
--- TMP/eclipse-junit-tests/src/main/scripts/test.xml.bak	2012-07-25 17:15:52.000000000 +0200
+++ TMP/eclipse-junit-tests/src/main/scripts/test.xml	2012-09-04 10:01:23.562816367 +0200
@@ -90,65 +90,20 @@
 		<antcall target="installTestPlugins" />
 	</target>
 
-	<!--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>
-						<os family="mac" />
-						<os arch="x86_64" />
-						<os arch="amd64" />
-					</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.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>
-		<condition property="platformTarget" value="platform-zip">
-			<contains string="${platformArchive}" substring=".zip" />
-		</condition>
-		<condition property="platformTarget" value="platform-tar.gz">
-			<contains string="${platformArchive}" substring=".tar.gz" />
-		</condition>
-		<echo message="platformTarget ${platformTarget} platformArchive ${platformArchive}" />
-		<antcall target="${platformTarget}" />
-	</target>
+    <!--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 name="platformArchive" value="${runtimeArchive}" />
+        
+        <condition property="platformTarget" value="platform-zip">
+            <contains string="${platformArchive}" substring=".zip" />
+        </condition>
+        <condition property="platformTarget" value="platform-tar.gz">
+            <contains string="${platformArchive}" substring=".tar.gz" />
+        </condition>
+        <echo message="platformTarget ${platformTarget} platformArchive ${platformArchive}" />
+        <antcall target="${platformTarget}" />
+    </target>
 
 
 	<!--setup for platform zip archives-->
--- TMP/eclipse-junit-tests/src/main/scripts/runtests.sh.bak	2012-07-25 17:15:52.000000000 +0200
+++ TMP/eclipse-junit-tests/src/main/scripts/runtests.sh	2012-09-04 10:02:38.616352712 +0200
@@ -1,4 +1,70 @@
 #!/bin/sh
+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
+}
 
 #set the DISPLAY for running tests on Linux
 #DISPLAY=`$HOST`:0.0;export DISPLAY
@@ -66,24 +132,38 @@
 
 #necessary when invoking this script through rsh
 cd $dir
-
+mkdir -p /tmp/eclipse-tests-directory
+pushd /tmp/eclipse-tests-directory
+rm -rf *
 # verify os, ws and arch values passed in are valid before running tests
 if [ "$os-$ws-$arch" = "linux-gtk-x86" ] || [ "$os-$ws-$arch" = "macosx-cocoa-ppc" ] || [ "$os-$ws-$arch" = "macosx-cocoa-x86" ] || [ "$os-$ws-$arch" = "aix-gtk-ppc" ] || [ "$os-$ws-$arch" = "aix-gtk-ppc64" ]  || [ "$os-$ws-$arch" = "solaris-gtk-sparc" ] || [ "$os-$ws-$arch" = "solaris-gtk-x86" ] || [ "$os-$ws-$arch" = "linux-gtk-ppc64" ] ||  [ "$os-$ws-$arch" = "linux-gtk-ia64" ] ||  [ "$os-$ws-$arch" = "linux-gtk-x86_64" ] ||  [ "$os-$ws-$arch" = "hpux-gtk-ia64_32"]
 then
-	if [ ! -r eclipse ]
-	then
-		tar -xzf eclipse-SDK-*.tar.gz
-		unzip -qq -o -C eclipse-junit-tests-*.zip */plugins/org.eclipse.test* -d eclipse/dropins/
+    if [ ! -r eclipse ]
+    then
+        pushd @libdir@
+        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/
 fi
 
+findXvncAndSetDisplay
+setArch
+
 # run tests
-launcher=`ls eclipse/plugins/org.eclipse.equinox.launcher_*.jar`
-$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
+eclipse -nosplash -data workspace -application org.eclipse.ant.core.antRunner \
+-file "/usr/share/java/eclipse-tests/test.xml" $tests \
+-Dws=$ws -Dos=$os -Darch=$arch -Dos.arch=$arch \
+-DbuildId=v20120903-1347 -Dbasedir="/tmp/eclipse-tests-directory" \
+-DruntimeArchive="eclipse-SDK-v20120903-1347-linux-gtk-x86_64.tar.gz" \
+-DrepoLocation="/usr/share/java/eclipse-tests" \
+-Dorg.eclipse.test="3.3.100" \
+-D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
 
+cleanupXvnc
 # display message to user if os, ws and arch are invalid
 else
 	echo "The os, ws and arch values are either invalid or are an invalid combination"
 
 exit 1
 fi
-
--- TMP/eclipse-junit-tests/src/main/scripts/test.xml.bak	2012-09-04 11:06:32.018103811 +0200
+++ TMP/eclipse-junit-tests/src/main/scripts/test.xml	2012-09-04 10:13:07.000000000 +0200
@@ -120,7 +120,7 @@
 		<delete dir="${platformLocation}" />
 		<mkdir dir="${platformLocation}" />
 		<exec dir="${platformLocation}" executable="tar">
-			<arg line="-xzf ${platformArchive}" />
+			<arg line="-xzf ../${platformArchive}" />
 		</exec>
 	</target>
 
--- TMP/eclipse-junit-tests/src/main/scripts/test.xml.bak	2012-09-06 09:11:00.000000000 +0200
+++ TMP/eclipse-junit-tests/src/main/scripts/test.xml	2012-09-06 09:12:14.131863056 +0200
@@ -949,9 +949,9 @@
 		<antcall target="uadoc" />
 		<antcall target="debug" />
 		<antcall target="ui" />
-		<antcall target="relEng" />
+		<!--antcall target="relEng" /-->
 		<antcall target="swt" />
-		<antcall target="teamcvs" />
+		<!--antcall target="teamcvs" /-->
 		<antcall target="equinoxds" />
 		<antcall target="equinoxp2discovery" />
 		<antcall target="bidi" />
--- TMP/eclipse-junit-tests/src/main/scripts/test.xml.bak	2012-09-06 09:14:04.000000000 +0200
+++ TMP/eclipse-junit-tests/src/main/scripts/test.xml	2012-09-06 10:42:12.066027428 +0200
@@ -390,6 +390,16 @@
 				<equals arg1="${testPluginX}" 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>
 		<antcall target="runSuite" />
 		<antcall target="genResults" />
 	</target>