mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
47 lines
1.2 KiB
Bash
Executable File
47 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
PHP_BINARY="php"
|
|
|
|
while getopts "p:" OPTION 2> /dev/null; do
|
|
case ${OPTION} in
|
|
p)
|
|
PHP_BINARY="$OPTARG"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
./tests/lint.sh -p "$PHP_BINARY"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo Lint scan failed!
|
|
exit 1
|
|
fi
|
|
|
|
rm server.log 2> /dev/null
|
|
mkdir -p ./plugins
|
|
|
|
cp -r tests/plugins/PocketMine-DevTools ./plugins
|
|
|
|
"$PHP_BINARY" ./plugins/PocketMine-DevTools/src/DevTools/ConsoleScript.php --make ./plugins/PocketMine-DevTools --relative ./plugins/PocketMine-DevTools --out ./plugins/DevTools.phar
|
|
rm -rf ./plugins/PocketMine-DevTools
|
|
|
|
echo -e "version\nmakeserver\nstop\n" | "$PHP_BINARY" src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline --debug.level=2
|
|
if ls plugins/DevTools/PocketMine*.phar >/dev/null 2>&1; then
|
|
echo Server phar created successfully.
|
|
else
|
|
echo No phar created!
|
|
exit 1
|
|
fi
|
|
|
|
cp -r tests/plugins/PocketMine-TesterPlugin ./plugins
|
|
"$PHP_BINARY" src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline --debug.level=2
|
|
|
|
result=$(grep 'TesterPlugin' server.log | grep 'Finished' | grep -v 'PASS')
|
|
if [ "$result" != "" ]; then
|
|
echo "$result"
|
|
echo Some tests did not complete successfully, changing build status to failed
|
|
exit 1
|
|
else
|
|
echo All tests passed
|
|
fi
|