MadelineProto/tests/test-conversion.sh

58 lines
1.1 KiB
Bash
Raw Normal View History

2019-12-26 19:17:31 +01:00
#!/bin/bash -e
madelinePath=$PWD
2019-12-26 19:47:24 +01:00
tempDir=/tmp/tempConv$1
rm -rf $tempDir
mkdir $tempDir
cd $tempDir
pwd
2019-12-26 19:17:31 +01:00
echo '{
"name": "danog/madelineprototests",
"minimum-stability":"dev",
"require": {
"danog/madelineproto": "dev-master",
"amphp/dns": "dev-master#ecbeca2ae0e93c08e8150a92810a3961fad8ecbe as v1"
},
"require-dev": {
"vlucas/phpdotenv": "^3"
},
"repositories": [
{
"type": "path",
"url": "'$madelinePath'",
"options": {
"symlink": false
}
}
],
"authors": [
{
"name": "Daniil Gentili",
"email": "daniil@daniil.it"
}
]
}' > composer.json
2019-12-26 20:05:06 +01:00
composer config platform.php "7.4"
#composer clearcache
2019-12-26 19:17:31 +01:00
composer update
2019-12-26 20:05:06 +01:00
composer dumpautoload --optimize
2019-12-26 19:17:31 +01:00
2019-12-26 19:47:24 +01:00
$madelinePath/tests/conversion/prepare-$1.sh
2019-12-26 19:17:31 +01:00
$madelinePath/vendor/bin/php7to$1 convert --copy-all vendor newVendor
rm -rf vendor
mv newVendor vendor
2019-12-26 19:47:24 +01:00
$madelinePath/tests/conversion/after-$1.sh
2019-12-26 19:17:31 +01:00
cd $madelinePath
if [ $1 -eq 5 ];then
2019-12-26 19:47:24 +01:00
php5.6 tests/testing.php $1
2019-12-26 19:17:31 +01:00
else
2019-12-26 19:47:24 +01:00
php7.0 tests/testing.php $1
2019-12-26 19:17:31 +01:00
fi