mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Improved Travis Test, capture error output from console, test phar
This commit is contained in:
parent
953c1ef4ec
commit
9b7868238c
@ -18,23 +18,25 @@ if [ $? -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
rm server.log 2> /dev/null
|
rm server.log 2> /dev/null
|
||||||
mkdir -p ./plugins
|
rm PocketMine-MP.phar 2> /dev/null
|
||||||
|
|
||||||
cp -r tests/plugins/PocketMine-DevTools ./plugins
|
cd tests/plugins/PocketMine-DevTools
|
||||||
|
"$PHP_BINARY" -dphar.readonly=0 ./src/DevTools/ConsoleScript.php --make ./ --relative ./ --out ../../../DevTools.phar
|
||||||
|
cd ../../..
|
||||||
|
|
||||||
"$PHP_BINARY" ./plugins/PocketMine-DevTools/src/DevTools/ConsoleScript.php --make ./plugins/PocketMine-DevTools --relative ./plugins/PocketMine-DevTools --out ./plugins/DevTools.phar
|
"$PHP_BINARY" -dphar.readonly=0 DevTools.phar --make src --relative ./ --entry src/pocketmine/PocketMine.php --out PocketMine-MP.phar
|
||||||
rm -rf ./plugins/PocketMine-DevTools
|
if [ -f PocketMine-MP.phar ]; then
|
||||||
|
|
||||||
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.
|
echo Server phar created successfully.
|
||||||
else
|
else
|
||||||
echo No phar created!
|
echo Server phar was not created!
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
mkdir plugins 2> /dev/null
|
||||||
|
mv DevTools.phar plugins
|
||||||
cp -r tests/plugins/PocketMine-TesterPlugin ./plugins
|
cp -r tests/plugins/PocketMine-TesterPlugin ./plugins
|
||||||
echo -e "stop\n" | "$PHP_BINARY" src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline --debug.level=2
|
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2
|
||||||
|
|
||||||
output=$(grep '\[TesterPlugin\]' server.log)
|
output=$(grep '\[TesterPlugin\]' server.log)
|
||||||
if [ "$output" == "" ]; then
|
if [ "$output" == "" ]; then
|
||||||
@ -47,6 +49,9 @@ if [ "$result" != "" ]; then
|
|||||||
echo "$result"
|
echo "$result"
|
||||||
echo Some tests did not complete successfully, changing build status to failed
|
echo Some tests did not complete successfully, changing build status to failed
|
||||||
exit 1
|
exit 1
|
||||||
|
elif [ $(grep -c "ERROR\|CRITICAL\|EMERGENCY" server.log) -ne 0 ]; then
|
||||||
|
echo Server log contains error messages, changing build status to failed
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
echo All tests passed
|
echo All tests passed
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user