Skip to content

Commit d04f059

Browse files
committed
Add descriptive error messages when checks fail
1 parent c16ce49 commit d04f059

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tests/before_script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
set -x
2+
13
phpunit_shim() {
24
# -class CurlTest extends \PHPUnit\Framework\TestCase
35
# +class CurlTest extends \PHPUnit_Framework_TestCase

tests/script.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
set -x
2+
13
errors=0
24

35
# Check syntax in php files. Use `xargs' over `find -exec' as xargs exits with a value of 1 when any command errors.
46
find . -type "f" -iname "*.php" ! -path "*/vendor/*" | xargs -L "1" php -l
57
if [[ "${?}" -ne 0 ]]; then
8+
echo "Error: php syntax checks failed"
69
((errors++))
710
fi
811

912
# Run tests.
1013
phpunit --version
1114
phpunit --configuration "tests/phpunit.xml"
1215
if [[ "${?}" -ne 0 ]]; then
16+
echo "Error: phpunit command failed"
1317
((errors++))
1418
fi
1519

@@ -125,6 +129,7 @@ phpcs \
125129
-s \
126130
.
127131
if [[ "${?}" -ne 0 ]]; then
132+
echo "Error: found standard violation(s)"
128133
((errors++))
129134
fi
130135

0 commit comments

Comments
 (0)