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 30604-e5d817ee12) Lines: 535 567 94.4 %
Date: 2026-01-10 09:22:24 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 186654
mul0r 482312
sqrs 730856
divur 2508484
divir 3502236
truedvmdsi 6202031
divrs 9871333
dbltor 13384958
dblexpo 25892312
int2u 26083304
mulrrz_int 53801027
mantissa_real 54194973
invmod2BIL 60787936
trunc2nr 62679288
invr_basecase 62863879
invr 62864320
addmulii_gen 90753403
int2n 106484729
mulsr 117484283
truedvmdis 131105483
truedvmdii 134184811
addmulii 168682458
mulss 201177042
usqrt 231948874
rtodbl 288684252
addmulii_lg3 472322842
sqrz_i 556260208
sqrr 589173690
mulsi 612472572
sqru 626824292
mulrrz_3 652472330
mulur_2 706215864
mulrrz_3end 773008911
mulur 928882687
mulir 988231780
divru 1083523811
mului 1111204089
affrr 1343457177
addmulii_inplace 1578207479
sqri 1900140089
shifti 2261654223
vals 2276475148
modii 3079473246
mulrrz_end 3557726852
mulrrz_i 3709749568
mulrr 3957368460
muluu 4565705481
mulii 20967279709

Generated by: LCOV version 1.16