Skip to content

Commit

Permalink
Merge branch 'master' into mcpe-1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jan 22, 2017
2 parents 08ed2cd + 3ab9722 commit 904c52b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 13 additions & 2 deletions tests/lint.sh
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions tests/plugins/PocketMine-DevTools
Submodule PocketMine-DevTools added at b4cdd6
8 changes: 0 additions & 8 deletions tests/run.sh

This file was deleted.

30 changes: 30 additions & 0 deletions tests/travis.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 904c52b

Please sign in to comment.