1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 09:19:40 +01:00
psalm/bin/test-with-real-projects.sh

59 lines
1.5 KiB
Bash
Raw Normal View History

2019-06-15 15:04:52 +02:00
#!/usr/bin/env bash
set -e
set -x
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
2022-11-10 17:10:46 +01:00
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
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/
rm -Rf testing-with-real-projects
mkdir -p testing-with-real-projects
2019-06-15 15:04:52 +02:00
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)
2021-12-26 08:47:38 +01:00
git clone --depth=1 git@github.com:psalm/endtoend-test-collections.git
cd endtoend-test-collections
composer install
"$PSALM" --monochrome --show-info=false
;;
2020-07-07 23:12:07 +02:00
psl)
# For circleCI
export PHP_EXTENSION_INTL=1
export PHP_EXTENSION_BCMATH=1
2021-07-09 22:58:37 +02:00
git clone git@github.com:psalm/endtoend-test-psl.git
cd endtoend-test-psl
git checkout 2.3.x
composer install
2023-11-27 15:00:31 +01:00
# Avoid conflicts with old psalm when running phar tests
rm -rf vendor/vimeo/psalm
2023-11-22 15:35:40 +01:00
sed 's/ErrorOutputBehavior::Packed, ErrorOutputBehavior::Discard/ErrorOutputBehavior::Discard/g' -i src/Psl/Shell/execute.php
2023-11-27 15:03:46 +01:00
"$PSALM_PHAR" --monochrome -c config/psalm.xml
"$PSALM_PHAR" --monochrome -c config/psalm.xml tests/static-analysis
2020-07-07 23:12:07 +02:00
;;
laravel)
2021-12-26 08:47:38 +01:00
git clone --depth=1 git@github.com:psalm/endtoend-test-laravel.git
cd endtoend-test-laravel
composer install
"$PSALM" --monochrome
;;
*)
2021-12-26 08:47:38 +01:00
echo "Usage: test-with-real-projects.sh {phpunit|collections|laravel|psl}"
exit 1
esac