Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - kernel/none - mp_indep.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30549-267e77144f) Lines: 535 567 94.4 %
Date: 2025-11-16 09:22:34 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
divsi 175
divsr 798
int2um1 8831
div0r 187460
mul0r 482315
sqrs 731815
divur 2509309
divir 3503623
truedvmdsi 6202031
divrs 9871120
dbltor 13389574
dblexpo 25890792
int2u 26156246
mantissa_real 53610450
mulrrz_int 53800594
invmod2BIL 60744900
trunc2nr 62698403
invr_basecase 62842532
invr 62843214
addmulii_gen 90737493
int2n 105938911
mulsr 117498183
truedvmdis 130879484
truedvmdii 133959543
addmulii 168633161
mulss 201178368
usqrt 232021754
rtodbl 288926841
addmulii_lg3 472709669
sqrz_i 555729793
sqrr 588548155
mulsi 609249918
sqru 626978697
mulrrz_3 652793083
mulur_2 704730193
mulrrz_3end 773480543
mulur 927282951
mulir 986032978
divru 1083638320
mului 1108311550
affrr 1343580440
addmulii_inplace 1581287706
sqri 1912099936
vals 2267328791
shifti 2269405552
modii 3084665729
mulrrz_end 3555671865
mulrrz_i 3710391073
mulrr 3956444698
muluu 4564240411
mulii 20976436843

Generated by: LCOV version 1.16