diff --git a/.travis.yml b/.travis.yml index b0e238cd7..32152c3a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/tests/lint.sh b/tests/lint.sh new file mode 100755 index 000000000..a2aa579a1 --- /dev/null +++ b/tests/lint.sh @@ -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. \ No newline at end of file diff --git a/tests/run.sh b/tests/run.sh new file mode 100755 index 000000000..24858a03b --- /dev/null +++ b/tests/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo -e "version\nmakeserver\nstop\n" | php src/pocketmine/PocketMine.php --no-wizard --disable-ansi +if ls plugins/DevTools/PocketMine*.phar >/dev/null 2>&1; then + echo Server phar created successfully. +else + echo No phar created! + exit 1 +fi \ No newline at end of file