mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Improved test coverage script.
This commit is contained in:
parent
beb358f8ee
commit
21c24fd7f0
18
test.sh
18
test.sh
@ -10,9 +10,11 @@ TESTINGENV=./.env.testing
|
|||||||
resetTestFlag=''
|
resetTestFlag=''
|
||||||
testflag=''
|
testflag=''
|
||||||
coverageflag=''
|
coverageflag=''
|
||||||
|
featureflag=''
|
||||||
featuretestclass=''
|
featuretestclass=''
|
||||||
verbalflag=''
|
verbalflag=''
|
||||||
testsuite=''
|
testsuite=''
|
||||||
|
configfile='phpunit.xml';
|
||||||
|
|
||||||
while getopts 'vcrtf:s:' flag; do
|
while getopts 'vcrtf:s:' flag; do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
@ -24,12 +26,14 @@ while getopts 'vcrtf:s:' flag; do
|
|||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
coverageflag='true'
|
coverageflag='true'
|
||||||
|
configfile='phpunit.coverage.xml';
|
||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
verbalflag=' -v --debug'
|
verbalflag=' -v --debug'
|
||||||
echo "Will be verbal about it"
|
echo "Will be verbal about it"
|
||||||
;;
|
;;
|
||||||
f)
|
f)
|
||||||
|
featureflag='true'
|
||||||
featuretestclass=./tests/Feature/$OPTARG
|
featuretestclass=./tests/Feature/$OPTARG
|
||||||
echo "Will only run Feature test $OPTARG"
|
echo "Will only run Feature test $OPTARG"
|
||||||
;;
|
;;
|
||||||
@ -41,6 +45,11 @@ while getopts 'vcrtf:s:' flag; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $coverageflag == "true" && $featureflag == "true" ]]
|
||||||
|
then
|
||||||
|
echo "Use config file specific.xml"
|
||||||
|
configfile='phpunit.coverage.specific.xml'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# backup current config (if it exists):
|
# backup current config (if it exists):
|
||||||
@ -99,12 +108,13 @@ else
|
|||||||
if [[ $coverageflag == "" ]]
|
if [[ $coverageflag == "" ]]
|
||||||
then
|
then
|
||||||
echo "Must run PHPUnit without coverage:"
|
echo "Must run PHPUnit without coverage:"
|
||||||
echo "phpunit --stop-on-error $verbalflag $featuretestclass $testsuite"
|
|
||||||
phpunit --stop-on-error $verbalflag $featuretestclass $testsuite
|
echo "phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite"
|
||||||
|
phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite
|
||||||
else
|
else
|
||||||
echo "Must run PHPUnit with coverage"
|
echo "Must run PHPUnit with coverage"
|
||||||
echo "phpunit --stop-on-error $verbalflag --configuration phpunit.coverage.xml $featuretestclass $testsuite"
|
echo "phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite"
|
||||||
phpunit --stop-on-error $verbalflag --configuration phpunit.coverage.xml $featuretestclass $testsuite
|
phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user