Skip to content

Instantly share code, notes, and snippets.

@SysPete
Created February 15, 2016 14:10
Show Gist options
  • Save SysPete/3a7cd3fc5f3e394c94eb to your computer and use it in GitHub Desktop.
Save SysPete/3a7cd3fc5f3e394c94eb to your computer and use it in GitHub Desktop.
coverage update script
#!/bin/bash
exec 2>&1
#set -e
set -x
export PATH="/usr/bin:/usr/sbin..:/bin:/usr/sbin:/usr/local/bin"
COVER_PERL="perl-5.20.3"
source /smoker/.bash_profile
DATE=`date '+%Y-%m-%d-%H-%M-%S'`
# foreach available perl
#perlbrew list | awk '{print $NF}' | while read perl
echo $COVER_PERL | while read perl
do
echo "***** $perl *****"
distros=(interchange6-schema Interchange6 Interchange6-Currency Dancer-Plugin-Interchange6 Dancer2-Plugin-Auth-Extensible Template-Flute Dancer2-Plugin-Auth-Extensible)
if [ $# -gt 0 ]
then
distros=($@)
fi
for n in ${distros[*]}
do
echo "***** $n *****"
cd /smoker/git/$n
# pull latest git
git checkout master
output=`git pull`
if [ "$output" == "Already up-to-date." ];then
echo "Nothing to do"
if [ $# -gt 0 ]
then
echo "forcing update"
else
continue
fi
fi
# installdeps
perlbrew exec --with $perl cpanm --installdeps -n .
perlbrew exec --with $perl perl Makefile.PL
perlbrew exec --with $perl make clean
if [ $perl == $COVER_PERL ]
then
echo using Devel::Cover
cover -delete /smoker/cover_db/$n
TMPDIR=/run/shm RELEASE_TESTING=1 HARNESS_PERL_SWITCHES=-MDevel::Cover \
DEVEL_COVER_OPTIONS="+ignore,\blib/Interchange6/Test/,\bt/,\bexample/,-coverage,pod-also_private-BUILDARGS,statement,condition,path,subroutine,time" \
perlbrew exec --with $perl prove -lr -j 2 t
mv cover_db /smoker/cover_db/$n
cover -report html_basic -annotation git /smoker/cover_db/$n
else
TMPDIR=/run/shm RELEASE_TESTING=1 make test
fi
perlbrew exec --with $perl perl Makefile.PL
perlbrew exec --with $perl make install
perlbrew exec --with $perl make clean
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment