summaryrefslogtreecommitdiffstats
path: root/prepRuntimeLocation.sh
diff options
context:
space:
mode:
authorRoland Grunberg <rgrunber@redhat.com>2013-08-28 14:09:33 -0400
committerRoland Grunberg <rgrunber@redhat.com>2013-08-28 14:09:33 -0400
commitba0467e5b48796e1733412f3126c15e4f2bb2c18 (patch)
tree55fdae9145c8b7327c5edc14e854437dabd6df93 /prepRuntimeLocation.sh
downloadtestbundle-to-eclipse-test-ba0467e5b48796e1733412f3126c15e4f2bb2c18.tar.gz
testbundle-to-eclipse-test-ba0467e5b48796e1733412f3126c15e4f2bb2c18.tar.xz
testbundle-to-eclipse-test-ba0467e5b48796e1733412f3126c15e4f2bb2c18.zip
Initial Commit.
Diffstat (limited to 'prepRuntimeLocation.sh')
-rwxr-xr-xprepRuntimeLocation.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/prepRuntimeLocation.sh b/prepRuntimeLocation.sh
new file mode 100755
index 0000000..7e88643
--- /dev/null
+++ b/prepRuntimeLocation.sh
@@ -0,0 +1,54 @@
+#! /bin/bash
+
+mkdir target
+pushd target
+
+# Prepare testing environment
+cp -rp /usr/share/java/eclipse-testing/* ./
+
+# Remove eclipse-tests p2 repo and generate for system
+rm -rf features plugins content.jar artifacts.jar binary
+/usr/share/java/tycho/copy-platform-all $(pwd)
+
+popd
+
+# Prepare the test.xml file
+
+sed -i 's/\${eclipse-home}\/plugins\/\${testPluginX}/\${testPluginX}/' target/test.xml
+sed -i '/<fileset/,/<\/fileset>/ s/dir="\${eclipse-home}\/plugins"/dir="\${basedir}"/' target/test.xml
+sed -i 's/refid="test.plugin.file" \/>/value="\${basedir}\/alltest.xml" \/>/' target/test.xml
+sed -i 's/\${report}/\${testPlugin}/' target/test.xml
+
+# Support multiple XML reports from same bundle but different test classes
+sed -i '/<attribute name="testPlugin"/ a <attribute name="testClass" \/>' target/test.xml
+sed -i 's/@{testPlugin}\.xml/@{testPlugin}-@{testClass}\.xml/' target/test.xml
+sed -i 's/\${testPlugin}\.xml/\${output-file}/' target/test.xml
+sed -i 's/\${testPlugin}_\${platform}\.xml/\${output-file}/' target/test.xml
+
+# Insert our test task
+sed -i '/<antcall target="quickTests" \/>/ d' target/test.xml
+sed -i '/<antcall target="longRunningTests" \/>/ d' target/test.xml
+sed -i '/<target name="all">/ a <antcall target="linuxtoolsTests" \/>' target/test.xml
+
+# Define our test task
+sed -i '/<target name="quickTests">/ i \
+<target name="linuxtoolsTests"> \
+<!-- Copy over the XML to generate a top-level report for all of the tests --> \
+ <mkdir dir="\${results}\/origXml" \/> \
+ <xslt style="\${repoLocation}\/splitter.xsl" basedir="\${results}\/xml" includes="*.xml" destdir="\${results}\/origXml"\/> \
+ <!-- Aggregate XML report files --> \
+ <junitreport todir="\${results}\/xml" tofile="org.eclipse.sdk.tests.xml"> \
+ <fileset dir="\${results}/origXml" includes="*.xml" \/> \
+ <\/junitreport> \
+ <!-- Generate top-level HTML report --> \
+ <xslt style="\${repoLocation}\/JUNIT.XSL" basedir="\${results}\/xml" includes="org.eclipse.sdk.tests.xml" destdir="\${results}\/html" \/> \
+<\/target>' target/test.xml
+
+sed -i 's/"-installIUs \(.*\)"/"-installIUs \1,org.eclipse.swtbot.eclipse.junit.headless"/' target/test.xml
+
+# Prepare the runtests.sh file
+
+sed -i '/cp \${testslocation}\/\*\.properties/ a cp \${testslocation}\/{JUNIT.XSL,alltest.xml,updateTestBundleXML.sh,swtbot-library.xml} \.' target/runtests.sh
+sed -i '/^properties=/ a testslocation=\$(pwd)' target/runtests.sh
+
+cp swtbot-library.xml alltest.xml updateTestBundleXML.sh target/