1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 16:59:45 +01:00
psalm/bin/test-with-real-projects.sh
Bruce Weirdan 7bca90e7bf
Portable bin/test-with-real-projects.sh
This replaces hardcoded paths to Psalm with dynamically built ones and
thus allows to run `bin/test-with-real-projects.sh` locally.
2021-07-15 00:43:45 +03:00

49 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
set -x
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
PSALM="$(readlink -f "$SCRIPT_DIR/../psalm")"
PSALM_PHAR="$(readlink -f "$SCRIPT_DIR/../build/psalm.phar")"
cd /tmp/
rm -Rf testing-with-real-projects
mkdir -p testing-with-real-projects
cd testing-with-real-projects
case $1 in
phpunit)
git clone --depth=1 git@github.com:psalm/endtoend-test-phpunit
cd endtoend-test-phpunit
composer install
"$PSALM_PHAR" --config=.psalm/config.xml --monochrome --show-info=false
"$PSALM_PHAR" --config=.psalm/static-analysis.xml --monochrome
;;
collections)
git clone --depth=1 git@github.com:muglug/collections.git
cd collections
composer install
"$PSALM" --monochrome --show-info=false
;;
psl)
git clone git@github.com:psalm/endtoend-test-psl.git
cd endtoend-test-psl
git checkout 1.6.x
composer install --ignore-platform-reqs
"$PSALM" --monochrome --config=tools/psalm/psalm.xml
;;
laravel)
git clone --depth=1 git@github.com:muglug/framework.git
cd framework
composer install
"$PSALM" --monochrome
;;
*)
echo "Usage: test-with-real-projects.sh {phpunit|collections|proxymanager|laravel|psl}"
exit 1
esac