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 30744-52374ab6cf) Lines: 535 567 94.4 %
Date: 2026-03-17 09:26:37 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 186614
mul0r 482270
sqrs 733872
divur 2524350
divir 3517576
truedvmdsi 6202031
divrs 9998038
dbltor 13463741
int2u 25350886
dblexpo 27271327
mulrrz_int 53799215
mantissa_real 54196710
invmod2BIL 60819572
trunc2nr 62838019
invr_basecase 65135100
invr 65135450
addmulii_gen 90686446
int2n 106542601
mulsr 120377642
truedvmdis 138861632
truedvmdii 141944238
addmulii 168736558
mulss 201180484
usqrt 252198386
rtodbl 295579726
addmulii_lg3 475513789
sqrz_i 562101933
sqrr 595526430
mulsi 617836442
sqru 640730856
mulrrz_3 658890422
mulur_2 723216997
mulrrz_3end 779853390
mulur 945848911
mulir 995807297
mului 1117630597
divru 1117653036
affrr 1379374904
addmulii_inplace 1617944328
sqri 2079241475
shifti 2288981139
vals 2317907382
modii 3123101796
mulrrz_end 3639208156
mulrrz_i 3793844122
mulrr 4040921300
muluu 4662131229
mulii 21178798336

Generated by: LCOV version 1.16