[php-src] PR #16987: Add unit test setup with php_network_connect_socket test
| From: | bukka | Date: | Fri, 29 Nov 2024 07:24:03 +0000 |
| Subject: | [php-src] PR #16987: Add unit test setup with php_network_connect_socket test | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29827@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16987
Author: bukka
This PR introduces new unit tests using cmocka. The idea is to use those tests for things that are
very hard to test using the integration tests (especially the networking related stuff).
Currently it just contains a test for
php_network_connect_socket that was used for
testing https://github.com/php/php-src/pull/16606 (this
was initially introduced as part of that PR but separated here to give more time for review).
The build is a bit rusty (single Makefile) but it depends on php-src build to be done first so
libphp.a is available. It means it requires a minimal php-src build (./configure --disable-all
--enable-embed=static). Not sure how to best integrate it to the php-src build so I just
chose to have it separate. Maybe @petk can have some suggestions how to improve the build here. It
might be also an option to create a separate configure.ac as it should probably check that
--wrap is available (e.g. it's not available on OSX) and cmocka installed.