From cccf5aa46fe9186a05c0c9f0276f036a0d35addf Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Tue, 3 Sep 2013 14:40:12 -0400 Subject: Fix individual test class pattern matching and create a run script. - Classes of the form '.+TestBar.+\.class' should not be matched. - A run script to perform all preparations, and running of tests. --- prepAllTestBundles.sh | 4 ++-- prepRuntimeLocation.sh | 4 ++++ runAllTestBundles.sh | 13 +++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 runAllTestBundles.sh diff --git a/prepAllTestBundles.sh b/prepAllTestBundles.sh index aacffee..4c72a37 100755 --- a/prepAllTestBundles.sh +++ b/prepAllTestBundles.sh @@ -6,7 +6,7 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html -# Run Eclipse Test Bundles +# Prepare Eclipse Test Bundles # The definiton of an Eclipse Test Bundle for our purposes is any packaged # OSGi bundle containing a pom.xml with a packaging type of @@ -44,7 +44,7 @@ for jar in `find ${testBundleFolder} -name "*.jar"`; do testclass=`jar -tf ${jar} | grep '/AllTests.class' | tr '/' '.' | sed 's/\.class//'` fi if [ "${testclass}" = '' ]; then - testclasses=`jar -tf ${jar} | grep -E '/[^/]*Test.*\.class' | grep -vE '/[^/]*Abstract.*\.class' | grep -v '\\$' | tr '/' '.' | sed 's/\.class//'` + testclasses=`jar -tf ${jar} | grep -E '/(Test.*\.class|.*Test\.class)' | grep -vE '/(Abstract.*\.class|.*Abstract\.class)' | grep -v '\\$' | tr '/' '.' | sed 's/\.class//'` else testclasses="${testclass}" fi diff --git a/prepRuntimeLocation.sh b/prepRuntimeLocation.sh index ce3ee86..6c471bc 100755 --- a/prepRuntimeLocation.sh +++ b/prepRuntimeLocation.sh @@ -4,6 +4,10 @@ mkdir target pushd target # Prepare testing environment +if [ ! -e /usr/share/java/eclipse-testing ]; then + echo "/usr/share/java/eclipse-testing/ does not exist. Please install the package providing this location." + exit 1 +fi cp -rp /usr/share/java/eclipse-testing/* ./ # Remove eclipse-tests p2 repo and generate for system diff --git a/runAllTestBundles.sh b/runAllTestBundles.sh new file mode 100755 index 0000000..0dd9caa --- /dev/null +++ b/runAllTestBundles.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +if [ ! $# -eq 1 ]; then + echo "USAGE : $0 PATH/TO/BUNDLES/DIRECTORY" + exit 1 +fi + +./prepRuntimeLocation.sh || exit 1 +./prepAllTestBundles.sh $1 || exit 1 + +pushd target + +./runtests.sh -os linux -ws gtk -arch `arch` -- cgit