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 30590-f14e077362) Lines: 535 567 94.4 %
Date: 2026-01-01 09:21:12 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168684632
addmulii_gen 90706116
addmulii_inplace 1581252474
addmulii_lg3 472744089
affrr 1343471825
dblexpo 25890696
dblmantissa 0
dbltor 13383891
div0r 186655
divir 3502242
divrs 9871278
divru 1083767174
divsi 175
divsr 798
divur 2508492
int2n 106039365
int2u 26081800
int2um1 8831
invmod2BIL 60827508
invr 62823163
invr_basecase 62822746
mantissa_real 53747993
modii 3081148225
mul0r 482266
mulii 20971994135
mulir 986795243
mulrr 3958023587
mulrrz_3 652608893
mulrrz_3end 773207337
mulrrz_end 3557069540
mulrrz_i 3709822797
mulrrz_int 53801066
mulsi 610619375
mulsr 117477120
mulss 201177111
mului 1108831832
mulur 927953322
mulur_2 705356183
muluu 4566620440
rtodbl 288637421
shifti 2260183239
sqri 1901298280
sqrr 589090361
sqrs 731262
sqru 626900877
sqrz_i 556256883
truedvmdii 134127675
truedvmdis 131045094
truedvmdsi 6202031
trunc2nr 62676317
usqrt 231665128
vals 2275824688

Generated by: LCOV version 1.16