Part of an upcoming php.net article titled “How can you help PHP.NET today?” with this part focusing on writing tests. It's essentially in a FAQ format:
Code coverage is important for the success of any project including PHP. When code coverage reaches 100%, it'll mean that every piece of code within the PHP sources will be executed while running the tests. This helps determine if behaviour changes so essentially it helps prevent bugs from being introduced into PHP.
gcc >= 3.4 with gcov. Your local setup should also include lcov that is available here:
Once installed, compile PHP with GCOV support using --enable-gcov so for example:
# wget foo.com/phpsrc.tar.gz # tar xfvz phpsrc.tar.gz # cd phpsrc # ./configure --with-foo --with-bar --enable-gcov # make
In summary: Install lcov, compile PHP with --enable-gcov, and now you're ready.
You can submit tests to the development mailing list @ internals@lists.php.net
Short answer: You don't. Long answer: valgrind can be used to detect if some test triggers a memory-related bug in PHP. Although running the test suite with valgrind is a plus, but it takes ages. You can submit tests without running valgrind, because the http://gcov.php.net project will do that for you.
Just untar it and run make install.