2019-06-15 15:04:52 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2021-07-14 23:43:45 +02:00
|
|
|
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
PSALM="$(readlink -f "$SCRIPT_DIR/../psalm")"
|
|
|
|
PSALM_PHAR="$(readlink -f "$SCRIPT_DIR/../build/psalm.phar")"
|
|
|
|
|
2019-06-15 15:04:52 +02:00
|
|
|
cd /tmp/
|
2021-07-14 23:43:45 +02:00
|
|
|
rm -Rf testing-with-real-projects
|
2020-04-06 02:25:50 +02:00
|
|
|
mkdir -p testing-with-real-projects
|
2019-06-15 15:04:52 +02:00
|
|
|
cd testing-with-real-projects
|
|
|
|
|
2020-04-06 02:25:50 +02:00
|
|
|
case $1 in
|
|
|
|
phpunit)
|
2021-07-04 19:40:50 +02:00
|
|
|
git clone --depth=1 git@github.com:psalm/endtoend-test-phpunit
|
|
|
|
cd endtoend-test-phpunit
|
2020-04-06 02:25:50 +02:00
|
|
|
composer install
|
2021-07-14 23:43:45 +02:00
|
|
|
"$PSALM_PHAR" --config=.psalm/config.xml --monochrome --show-info=false
|
|
|
|
"$PSALM_PHAR" --config=.psalm/static-analysis.xml --monochrome
|
2020-04-06 02:25:50 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
collections)
|
2021-07-04 19:40:50 +02:00
|
|
|
git clone --depth=1 git@github.com:muglug/collections.git
|
2020-04-06 02:25:50 +02:00
|
|
|
cd collections
|
|
|
|
composer install
|
2021-07-14 23:43:45 +02:00
|
|
|
"$PSALM" --monochrome --show-info=false
|
2020-04-06 02:25:50 +02:00
|
|
|
;;
|
|
|
|
|
2020-07-07 23:12:07 +02:00
|
|
|
psl)
|
2021-07-09 22:58:37 +02:00
|
|
|
git clone git@github.com:psalm/endtoend-test-psl.git
|
|
|
|
cd endtoend-test-psl
|
2021-10-28 06:50:44 +02:00
|
|
|
git checkout 1.9.x
|
|
|
|
composer require --dev php-standard-library/psalm-plugin --ignore-platform-reqs
|
|
|
|
cd tools/phpbench && composer install --ignore-platform-reqs && cd ../..
|
2021-07-14 23:43:45 +02:00
|
|
|
"$PSALM" --monochrome --config=tools/psalm/psalm.xml
|
2020-07-07 23:12:07 +02:00
|
|
|
;;
|
|
|
|
|
2020-06-15 23:24:23 +02:00
|
|
|
laravel)
|
2021-07-04 19:40:50 +02:00
|
|
|
git clone --depth=1 git@github.com:muglug/framework.git
|
2020-06-15 23:24:23 +02:00
|
|
|
cd framework
|
|
|
|
composer install
|
2021-07-14 23:43:45 +02:00
|
|
|
"$PSALM" --monochrome
|
2020-06-15 23:24:23 +02:00
|
|
|
;;
|
2020-04-06 02:25:50 +02:00
|
|
|
*)
|
2020-07-07 23:12:07 +02:00
|
|
|
echo "Usage: test-with-real-projects.sh {phpunit|collections|proxymanager|laravel|psl}"
|
2020-04-06 02:25:50 +02:00
|
|
|
exit 1
|
|
|
|
esac
|