Merge branch 'master' into mcpe-1.0

This commit is contained in:
Dylan K. Taylor 2017-01-22 16:08:34 +00:00
commit 904c52bb0f
6 changed files with 48 additions and 17 deletions

3
.gitmodules vendored
View File

@ -11,3 +11,6 @@
[submodule "tests/preprocessor"]
path = tests/preprocessor
url = https://github.com/pmmp/preprocessor.git
[submodule "tests/plugins/PocketMine-DevTools"]
path = tests/plugins/PocketMine-DevTools
url = https://github.com/pmmp/PocketMine-DevTools.git

View File

@ -4,18 +4,12 @@ php:
- 7.0
before_script:
- mkdir plugins
# - curl -o DevTools.zip "https://jenkins.pmmp.io/job/PocketMine-MP%20DevTools/lastSuccessfulBuild/artifact/*zip*/artifacts.zip"
# - unzip DevTools.zip
# - mv *.phar plugins
- pecl install channel://pecl.php.net/pthreads-3.1.6
- pecl install channel://pecl.php.net/weakref-0.3.2
- echo | pecl install channel://pecl.php.net/yaml-2.0.0
- git clone https://github.com/pmmp/PocketMine-DevTools.git -b api3
- php PocketMine-DevTools/src/DevTools/ConsoleScript.php --make "./PocketMine-DevTools" --relative "./PocketMine-DevTools" --out "./plugins/DevTools.phar"
script:
- ./tests/lint.sh && ./tests/run.sh
- ./tests/travis.sh
notifications:
email: false

View File

@ -1,8 +1,19 @@
#!/bin/bash
PHP_BINARY="php"
while getopts "p:" OPTION 2> /dev/null; do
case ${OPTION} in
p)
PHP_BINARY="$OPTARG"
;;
esac
done
echo Running PHP lint scans...
shopt -s globstar
for file in src/pocketmine/*.php src/pocketmine/**/*.php; do
OUTPUT=`php -l "$file"`
[ $? -ne 0 ] && echo -n "$OUTPUT" && exit 1
OUTPUT=`"$PHP_BINARY" -l "$file"`
[ $? -ne 0 ] && echo -n "$OUTPUT" && exit 1
done
echo Lint scan completed successfully.

@ -0,0 +1 @@
Subproject commit b4cdd61755f328ec6441e0216a67f80bf09162f4

View File

@ -1,8 +0,0 @@
#!/bin/bash
echo -e "version\nmakeserver\nstop\n" | php 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

30
tests/travis.sh Executable file
View File

@ -0,0 +1,30 @@
#!/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
cp -r tests/plugins 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