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:
parent
12023bd81e
commit
9559d32241
@ -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()
|
||||
{
|
||||
|
@ -8,6 +8,8 @@ use Icicle\Tests\Concurrent\TestCase;
|
||||
|
||||
/**
|
||||
* @group posix
|
||||
* @requires extension shmop
|
||||
* @requires extension sysvsem
|
||||
*/
|
||||
class PosixSemaphoreTest extends TestCase
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user