Skip to content

Commit

Permalink
Adding local travis-like cover test script
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed May 31, 2017
1 parent ae5d694 commit 8c6d285
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions travis_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
#
# Travis like test/cover
#
# Usage:
# travis_test.sh (all tests)
# travis_test.sh FILE (one file)
#
# P@ 2017
FILE=$1

carton exec 'cpanm --notest Perl::Tidy'
carton exec 'cpanm --quiet --notest --skip-satisfied Devel::Cover'
carton exec 'perl Build.PL && ./Build build'

if [ -d cover_db ]; then
rm -rf cover_db/
fi

if [ "${FILE}" != ""]; then
carton exec "PERL5OPT=-MDevel::Cover env perl -Ilib ${FILE}"
else
carton exec 'cover -test'
fi

if [ -d cover_db ]; then
rm -rf cover_db/
fi
carton exec './Build realclean'

0 comments on commit 8c6d285

Please sign in to comment.