summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg <rgrunber@redhat.com>2013-10-08 13:31:37 -0400
committerRoland Grunberg <rgrunber@redhat.com>2013-10-08 14:46:00 -0400
commit50a22cbb69bd72207bee474ee51ac36b805a405f (patch)
tree7f4828ad95b80508810d204497f5bf71240b060b
parent24dcbf8771f27d61981018f687bff696106b955b (diff)
downloadtestbundle-to-eclipse-test-50a22cbb69bd72207bee474ee51ac36b805a405f.tar.gz
testbundle-to-eclipse-test-50a22cbb69bd72207bee474ee51ac36b805a405f.tar.xz
testbundle-to-eclipse-test-50a22cbb69bd72207bee474ee51ac36b805a405f.zip
Add basic support for non-default test includes.
-rwxr-xr-xprepAllTestBundles.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/prepAllTestBundles.sh b/prepAllTestBundles.sh
index ebf32d9..37a5666 100755
--- a/prepAllTestBundles.sh
+++ b/prepAllTestBundles.sh
@@ -39,14 +39,26 @@ for jar in `find ${testBundleFolder} -name "*.jar"`; do
fi
# Find Test class(es)
+ includepatterns=
+ testclasses=
testclass=`unzip -p ${jar} ${jarPomPath} | grep '<testClass>' | sed 's/.*<testClass>\(.*\)<\/testClass>.*/\1/'`
if [ "${testclass}" = '' ]; then
- testclass=`jar -tf ${jar} | grep '/AllTests.class' | tr '/' '.' | sed 's/\.class//'`
+ # Check for custom includes
+ includepatterns=`unzip -p ${jar} ${jarPomPath} | sed -n '/<includes>/,/<\/includes>/p' | sed -n 's/.*<include>\(.*\)<\/include>.*/\1/p' | sed 's/\*\*/\.\*/'`
+ for pat in ${includepatterns}; do
+ testclasses="${testclasses} `jar -tf ${jar} | grep -E "${pat}" | grep '.class' | grep -v '\\$' | tr '/' '.' | sed 's/\.class//'`"
+ done
+ if [ "${includepatterns}" = '' ]; then
+ testclass=`jar -tf ${jar} | grep '/AllTests.class' | tr '/' '.' | sed 's/\.class//'`
+ fi
fi
if [ "${testclass}" = '' ]; then
- testclasses=`jar -tf ${jar} | grep -E '/(Test.*\.class|.*Test\.class)' | grep -vE '/(Abstract.*\.class|.*Abstract\.class)' | grep -v '\\$' | tr '/' '.' | sed 's/\.class//'`
+ if [ "${includepatterns}" = '' ]; then
+ # Use default includes
+ testclasses=`jar -tf ${jar} | grep -E '/(Test.*\.class|.*Test\.class)' | grep -vE '/(Abstract.*\.class|.*Abstract\.class)' | grep -v '\\$' | tr '/' '.' | sed 's/\.class//'`
+ fi
else
- testclasses="${testclass}"
+ testclasses="${testclass}"
fi
for testclass in ${testclasses} ; do