mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Better scripts (accept arguments)
This commit is contained in:
parent
7b040e8583
commit
d672f0c2ad
34
cover.sh
34
cover.sh
@ -18,7 +18,39 @@ then
|
||||
fi
|
||||
|
||||
# test!
|
||||
phpdbg -qrr /usr/local/bin/phpunit
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Running all tests..."
|
||||
phpunit --verbose
|
||||
fi
|
||||
|
||||
# test selective..
|
||||
dirs=("acceptance/Controllers" "acceptance/Controllers/Auth" "acceptance/Controllers/Chart" "unit")
|
||||
#
|
||||
if [ ! -z "$1" ]
|
||||
then
|
||||
for i in "${dirs[@]}"
|
||||
do
|
||||
firstFile="./tests/$i/$1.php"
|
||||
secondFile="./tests/$i/$1Test.php"
|
||||
if [ -f "$firstFile" ]
|
||||
then
|
||||
# run it!
|
||||
echo "Now running $firstFile"
|
||||
phpunit --verbose $firstFile
|
||||
exit $?
|
||||
fi
|
||||
if [ -f "$secondFile" ]
|
||||
then
|
||||
# run it!
|
||||
echo "Now running $secondFile"
|
||||
phpunit --verbose $secondFile
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
# restore .env file
|
||||
cp .env.local .env
|
||||
|
35
pu.sh
35
pu.sh
@ -23,7 +23,40 @@ then
|
||||
fi
|
||||
|
||||
# test!
|
||||
phpunit
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Running all tests..."
|
||||
phpunit
|
||||
fi
|
||||
|
||||
# test selective..
|
||||
dirs=("acceptance/Controllers" "acceptance/Controllers/Auth" "acceptance/Controllers/Chart" "unit")
|
||||
#
|
||||
if [ ! -z "$1" ]
|
||||
then
|
||||
for i in "${dirs[@]}"
|
||||
do
|
||||
firstFile="./tests/$i/$1.php"
|
||||
secondFile="./tests/$i/$1Test.php"
|
||||
if [ -f "$firstFile" ]
|
||||
then
|
||||
# run it!
|
||||
echo "Now running $firstFile"
|
||||
phpunit --verbose $firstFile
|
||||
exit $?
|
||||
fi
|
||||
if [ -f "$secondFile" ]
|
||||
then
|
||||
# run it!
|
||||
echo "Now running $secondFile"
|
||||
phpunit --verbose $secondFile
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# restore .env file
|
||||
cp .env.local .env
|
||||
|
Loading…
Reference in New Issue
Block a user