문제

I am using PHPUnit 3.5.10, and having a problem trying to generate xml reports for clover-coverage.

Exporting with coverage-html works fine. Also, if I exclude enough files from the coverage report it will generate the clover.xml file. However, when I run my test suite, I get the message "Writing code coverage data to XML file, this may take a moment.", and then the execution fails silently. Every 1 of 25 times I will get a "Segmentation Fault" message.

Initially, I traced this problem to the PHP_CodeCoverage::getSummary() function, however when I restricted the code coverage with a whitelist, the program got past this error.

Next, the code coverage reports seem to time out in the PHP_Token_Stream::scan() function. Effectively, after a cumulative of about 31k tokens have been processed, the method simply halts with no error message.

I have noticed a correlation to the amount of tracing code I put in place, and the number of tokens that the method will process. So it would appear the program may be running out of memory.

I have created a test to load in a bunch of my code files and test PHP_Token_Stream by loading a the files, one after another. This seems to function as expected, and does not replicate the error as it appears within the context of the test suite.

Any suggestions on how to output my clover-coverage reports?

도움이 되었습니까?

해결책

We run most of our projects' unit tests with 1GB, but one we had to kick up to 2GB to allow for code coverage. Try increasing the memory limit for PHP using

ini_set('memory_limit', '1024M');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top