Merge branch 'ci'

This commit is contained in:
Dylan K. Taylor 2016-10-18 13:57:13 +01:00
commit 4bc2275fc3
4 changed files with 17 additions and 50 deletions

View File

@ -11,7 +11,7 @@ before_script:
- echo | pecl install channel://pecl.php.net/yaml-2.0.0RC7
script:
- php tests/TravisTest.php
- ./tests/lint.sh && ./tests/run.sh
notifications:
email: false

View File

@ -1,49 +0,0 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
$server = proc_open(PHP_BINARY . " src/pocketmine/PocketMine.php --no-wizard --disable-readline", [
0 => ["pipe", "r"],
1 => ["pipe", "w"],
2 => ["pipe", "w"]
], $pipes);
if(!is_resource($server)){
die('Failed to create process');
}
fwrite($pipes[0], "version\nmakeserver\nstop\n\n");
fclose($pipes[0]);
while(!feof($pipes[1])){
echo fgets($pipes[1]);
}
fclose($pipes[1]);
fclose($pipes[2]);
echo "\n\nReturn value: ". proc_close($server) ."\n";
if(count(glob("plugins/DevTools/PocketMine-MP*.phar")) === 0){
echo "No server Phar created!\n";
exit(1);
}else{
exit(0);
}

8
tests/lint.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
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
done
echo Lint scan completed successfully.

8
tests/run.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
echo -e "version\nmakeserver\nstop\n" | php src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline
if ls plugins/DevTools/PocketMine*.phar >/dev/null 2>&1; then
echo Server phar created successfully.
else
echo No phar created!
exit 1
fi