1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 19:24:42 +01:00
MadelineProto/tests/test.sh

63 lines
1.1 KiB
Bash
Raw Normal View History

2023-09-01 17:14:30 +02:00
#!/bin/bash
set -ex
2023-09-01 14:56:43 +02:00
2023-11-30 19:20:12 +01:00
export COMPOSER_PROCESS_TIMEOUT=100000
2023-09-01 14:56:43 +02:00
2023-11-30 19:38:26 +01:00
apk add procps git unzip github-cli openssh
cd /tmp
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
cd $OLDPWD
2023-12-23 20:35:35 +01:00
php tests/jit.php
2023-11-30 19:38:26 +01:00
2023-11-30 19:30:29 +01:00
php tests/lock_setup.php
2023-09-01 14:56:43 +02:00
2023-11-30 19:21:40 +01:00
if [ "$1" == "cs" ]; then
2023-11-30 19:05:41 +01:00
rmdir docs
curl -L https://github.com/danog/MadelineProtoDocs/archive/refs/heads/master.tar.gz | tar -xz
mv MadelineProtoDocs-master/ docs
git submodule init schemas
git submodule update schemas
composer docs
composer docs-fix
composer cs-fix
if [ "$(git diff)" != "" ]; then echo "Please run composer build!"; exit 1; fi
exit 0
fi
if [ "$1" == "handshake" ]; then
2023-11-30 19:06:46 +01:00
php tests/handshake.php
2023-11-30 19:05:41 +01:00
exit 0
fi
2023-11-30 21:02:26 +01:00
if [ "$1" == "psalm" ]; then
composer psalm
exit 0
fi
2023-11-30 19:05:41 +01:00
if [ "$1" == "phpunit" ]; then
2023-12-07 19:14:57 +01:00
#composer test
composer test-light
2023-11-30 19:05:41 +01:00
exit 0
fi
if [ "$1" == "phpunit-light" ]; then
composer test-light
exit 0
fi
echo "Unknown command!"
2023-11-19 19:14:51 +01:00
2023-12-07 19:14:57 +01:00
exit 1