Hi

On 08/12/2023 17:04, Vinicius Dias wrote:
>> The code coverage report can be found at 
>> https://app.codecov.io/github/php/php-src
> 
> Ah, perfect. Thank you for sharing. I will take a closer look after
> work, but something seems weird to me. Here[1] you see that
> ctype_alpha seems to be uncovered, but here[2] we can see that it's
> tested.
> 
> [1]: 
> https://app.codecov.io/github/php/php-src/blob/master/ext%2Fctype%2Fctype.c#L112
> [2]: 
> https://github.com/php/php-src/blob/master/ext/ctype/tests/ctype_alpha_basic.phpt

You'll see this kind of stuff with macros.
The coverage report shows "partially covered" code as uncovered due to a 
limitation.
In this particular example, the parameter parsing code failure isn't tested, so 
it marks the whole macro as untested.

You'll see this many times in the PHP codebase.
Also for example for RETURN_THROWS: because that macro performs an assertion 
it's always in red because the assertion isn't hit in our testing (and that's a 
good thing because if it were hit then it means there's a bug).

Kind regards
Niels

> 
> 
>> I will have a look, the page overall looks like it could need some love ;-)
>> In the meantime if you are interested in writing tests, I once wrote a blog 
>> post about that topic at 
>> https://dev.to/realflowcontrol/growing-the-php-core-one-test-at-a-time-4g4k
> Ah, that's great. Thank you for that! :-D
> 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to