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

Generated by: LCOV version 1.16