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
addmulii 168736558
addmulii_gen 90686446
addmulii_inplace 1617944328
addmulii_lg3 475513789
affrr 1379374904
dblexpo 27271327
dblmantissa 0
dbltor 13463741
div0r 186614
divir 3517576
divrs 9998038
divru 1117653036
divsi 175
divsr 798
divur 2524350
int2n 106542601
int2u 25350886
int2um1 8831
invmod2BIL 60819572
invr 65135450
invr_basecase 65135100
mantissa_real 54196710
modii 3123101796
mul0r 482270
mulii 21178798336
mulir 995807297
mulrr 4040921300
mulrrz_3 658890422
mulrrz_3end 779853390
mulrrz_end 3639208156
mulrrz_i 3793844122
mulrrz_int 53799215
mulsi 617836442
mulsr 120377642
mulss 201180484
mului 1117630597
mulur 945848911
mulur_2 723216997
muluu 4662131229
rtodbl 295579726
shifti 2288981139
sqri 2079241475
sqrr 595526430
sqrs 733872
sqru 640730856
sqrz_i 562101933
truedvmdii 141944238
truedvmdis 138861632
truedvmdsi 6202031
trunc2nr 62838019
usqrt 252198386
vals 2317907382

Generated by: LCOV version 1.16