mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
Add DevTools as submodule, build DevTools for Travis Test
This commit is contained in:
parent
06f0534d65
commit
3ab9722a9f
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -11,3 +11,6 @@
|
|||||||
[submodule "tests/preprocessor"]
|
[submodule "tests/preprocessor"]
|
||||||
path = tests/preprocessor
|
path = tests/preprocessor
|
||||||
url = https://github.com/pmmp/preprocessor.git
|
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
|
||||||
|
@ -4,14 +4,12 @@ php:
|
|||||||
- 7.0
|
- 7.0
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir plugins
|
|
||||||
- wget -O plugins/DevTools.phar https://github.com/PocketMine/DevTools/releases/download/v1.11.0/DevTools_v1.11.0.phar
|
|
||||||
- pecl install channel://pecl.php.net/pthreads-3.1.6
|
- pecl install channel://pecl.php.net/pthreads-3.1.6
|
||||||
- pecl install channel://pecl.php.net/weakref-0.3.2
|
- pecl install channel://pecl.php.net/weakref-0.3.2
|
||||||
- echo | pecl install channel://pecl.php.net/yaml-2.0.0
|
- echo | pecl install channel://pecl.php.net/yaml-2.0.0
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./tests/lint.sh && ./tests/run.sh
|
- ./tests/travis.sh
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
@ -1,8 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/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...
|
echo Running PHP lint scans...
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
for file in src/pocketmine/*.php src/pocketmine/**/*.php; do
|
for file in src/pocketmine/*.php src/pocketmine/**/*.php; do
|
||||||
OUTPUT=`php -l "$file"`
|
OUTPUT=`"$PHP_BINARY" -l "$file"`
|
||||||
[ $? -ne 0 ] && echo -n "$OUTPUT" && exit 1
|
[ $? -ne 0 ] && echo -n "$OUTPUT" && exit 1
|
||||||
done
|
done
|
||||||
echo Lint scan completed successfully.
|
echo Lint scan completed successfully.
|
1
tests/plugins/PocketMine-DevTools
Submodule
1
tests/plugins/PocketMine-DevTools
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b4cdd61755f328ec6441e0216a67f80bf09162f4
|
@ -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
30
tests/travis.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user