Good Morning PHP Internals!
I'm trying to get some unit test coverage on some functionality that requires two separate processes, and I'm wondering how to do this with a *.phpt.
WinCache has a cross-process lock functionality that allows synchronization between two processes. (See: http://php.net/manual/en/function.wincache-lock.php).
I looked through https://qa.php.net/write-test.php, but I'm not seeing anything that supports spinning up multiple instances of the test.
Is there any special handling a phpt needs to do if it calls exec()
? (http://php.net/manual/en/function.exec.php)
Thx!
--E.
Clarification: your test depends on being able to run multiple instances of
the same test at the same time?
run-tests runs one test at a time. It does launch a separate php.exe for
each test, but it doesn't use non-blocking popen or pcntl, so it can only
run one test at a time.
Additionally, you need to specify which tests must be run at same time (and
how many, 2, 3, 4), neither of which run-tests is designed to do(its a
light weight tool as opposed to PFTT which is very heavy weight).
Alternatively, PFTT normally runs multiple tests at the same time and has a
few extensions to the PHPT format. I could add another extension to the
PHPT format to PFTT for your test. Extensions for PHPT test would specify
which tests have to be run at same time, how many to run (2, 3, 4) and
optionally skip test on run-tests.
Do you have a PHPT test written or pseudo code for one? That would help.
Would be great to improve test coverage of WinCache (fe: there's some test
php scripts afair that should be converted to PHPTs)
Regards
-M
On Mon, Aug 24, 2015 at 10:31 AM, Eric Stenson ericsten@microsoft.com
wrote:
Good Morning PHP Internals!
I'm trying to get some unit test coverage on some functionality that
requires two separate processes, and I'm wondering how to do this with a
*.phpt.WinCache has a cross-process lock functionality that allows
synchronization between two processes. (See:
http://php.net/manual/en/function.wincache-lock.php).I looked through https://qa.php.net/write-test.php, but I'm not seeing
anything that supports spinning up multiple instances of the test.Is there any special handling a phpt needs to do if it calls
exec()
? (
http://php.net/manual/en/function.exec.php)Thx!
--E.