Merge branch 'master' into mcpe-1.1

This commit is contained in:
Dylan K. Taylor 2017-05-18 11:29:52 +01:00
commit 85c1535c75
6 changed files with 33 additions and 6 deletions

3
.gitmodules vendored
View File

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

View File

@ -234,7 +234,6 @@ namespace pocketmine {
} }
return parse_offset($offset); return parse_offset($offset);
break;
case 'linux': case 'linux':
// Ubuntu / Debian. // Ubuntu / Debian.
if(file_exists('/etc/timezone')){ if(file_exists('/etc/timezone')){
@ -261,7 +260,6 @@ namespace pocketmine {
} }
return parse_offset($offset); return parse_offset($offset);
break;
case 'mac': case 'mac':
if(is_link('/etc/localtime')){ if(is_link('/etc/localtime')){
$filename = readlink('/etc/localtime'); $filename = readlink('/etc/localtime');
@ -272,10 +270,8 @@ namespace pocketmine {
} }
return false; return false;
break;
default: default:
return false; return false;
break;
} }
} }

View File

@ -136,6 +136,14 @@ class AsyncPool{
$this->taskWorkers = []; $this->taskWorkers = [];
$this->tasks = []; $this->tasks = [];
$this->collectWorkers();
}
private function collectWorkers(){
foreach($this->workers as $worker){
$worker->collect();
}
} }
public function collectTasks(){ public function collectTasks(){
@ -158,6 +166,8 @@ class AsyncPool{
} }
} }
$this->collectWorkers();
Timings::$schedulerAsyncTimer->stopTiming(); Timings::$schedulerAsyncTimer->stopTiming();
} }
} }

View File

@ -261,7 +261,8 @@ abstract class AsyncTask extends Collectable{
$this->{$p} = null; $this->{$p} = null;
} }
} }
}
$this->setGarbage();
}
} }

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

View File

@ -17,7 +17,11 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
cp -r tests/plugins plugins rm server.log 2> /dev/null
mkdir -p ./plugins
cp -r tests/plugins/PocketMine-DevTools ./plugins
"$PHP_BINARY" ./plugins/PocketMine-DevTools/src/DevTools/ConsoleScript.php --make ./plugins/PocketMine-DevTools --relative ./plugins/PocketMine-DevTools --out ./plugins/DevTools.phar "$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 rm -rf ./plugins/PocketMine-DevTools
@ -28,3 +32,15 @@ else
echo No phar created! echo No phar created!
exit 1 exit 1
fi fi
cp -r tests/plugins/PocketMine-TesterPlugin ./plugins
"$PHP_BINARY" src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline --debug.level=2
result=$(grep 'TesterPlugin' server.log | grep 'Finished' | grep -v 'PASS')
if [ "$result" != "" ]; then
echo "$result"
echo Some tests did not complete successfully, changing build status to failed
exit 1
else
echo All tests passed
fi