Skip to content

Commit

Permalink
Merge pull request #10 from php-translation/patch-3
Browse files Browse the repository at this point in the history
Added test script.
  • Loading branch information
Nyholm committed Dec 16, 2016
2 parents 78cd0d9 + dd72943 commit ee7b57d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
8 changes: 2 additions & 6 deletions composer.json
Expand Up @@ -12,9 +12,6 @@
"php": "^5.5 || ^7.0",
"php-translation/common": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "^4.5 || ^5.4"
},
"autoload": {
"psr-4": {
"Translation\\PlatformAdapter\\": "src/"
Expand All @@ -26,8 +23,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
"test": "./run-tests.sh",
"test-ci": "./run-tests.sh --coverage-text --coverage-clover=build/coverage.xml"
}
}

32 changes: 32 additions & 0 deletions run-tests.sh
@@ -0,0 +1,32 @@
#!/bin/bash
EXIT="0"
ROOT=$(pwd)

for D in `find ./src -type d -mindepth 1 -maxdepth 1`
do
echo "Checking $D"
if grep -Fxq "$TRAVIS_PHP_VERSION" $D/travis.ini
then
cd $D
echo "Updating dependencies"
composer update

echo "Running tests"
./vendor/bin/phpunit "$@"

EXITCODE=$?

# If there is an error, make sure to return it.
if [ "$EXITCODE" -ne "0" ]; then
EXIT=$EXITCODE
printError $DIR $EXITCODE
fi

cd $ROOT
else
echo "Skipping"
fi
done

echo "Exiting with code: $EXIT"
exit "$EXIT"
File renamed without changes.

0 comments on commit ee7b57d

Please sign in to comment.