1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 04:44:56 +01:00

Fix broken tests & add skips when extension needed

This commit is contained in:
coderstephen 2015-08-28 15:09:07 -05:00
parent 12023bd81e
commit 9559d32241
5 changed files with 16 additions and 4 deletions

View File

@ -4,6 +4,9 @@ namespace Icicle\Tests\Concurrent\Sync;
use Icicle\Concurrent\Sync\Parcel;
use Icicle\Tests\Concurrent\TestCase;
/**
* @requires extension shmop
*/
class ParcelTest extends TestCase
{
public function testConstructor()
@ -88,6 +91,7 @@ class ParcelTest extends TestCase
/**
* @group posix
* @requires extension pcntl
*/
public function testSetInSeparateProcess()
{
@ -103,6 +107,7 @@ class ParcelTest extends TestCase
/**
* @group posix
* @requires extension pcntl
*/
public function testFreeInSeparateProcess()
{

View File

@ -8,6 +8,8 @@ use Icicle\Tests\Concurrent\TestCase;
/**
* @group posix
* @requires extension shmop
* @requires extension sysvsem
*/
class PosixSemaphoreTest extends TestCase
{

View File

@ -8,6 +8,7 @@ use Icicle\Tests\Concurrent\TestCase;
/**
* @group threading
* @requires extension pthreads
*/
class ThreadedMutexTest extends TestCase
{
@ -46,6 +47,6 @@ class ThreadedMutexTest extends TestCase
});
Loop\run();
}, 1.5, 1.65);
}, 1.5, 1.7);
}
}

View File

@ -8,6 +8,7 @@ use Icicle\Tests\Concurrent\TestCase;
/**
* @group threading
* @requires extension pthreads
*/
class ThreadedSemaphoreTest extends TestCase
{
@ -52,6 +53,6 @@ class ThreadedSemaphoreTest extends TestCase
});
Loop\run();
}, 1.5, 1.65);
}, 1.5, 1.7);
}
}

View File

@ -82,14 +82,17 @@ class LocalObjectTest extends TestCase
$this->assertSame($object, $local->deref());
}
/**
* @requires extension pthreads
*/
public function testPromiseInThread()
{
$thread = \Thread::from(function () {
require __DIR__.'/../../vendor/autoload.php';
$promise = new LocalObject(new Promise());
$promise = new LocalObject(new Promise(function ($resolve, $reject) {}));
});
$thread->start(PTHREADS_INHERIT_INI);
$thread->start();
$thread->join();
}