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 30735-65f72320ad) Lines: 535 567 94.4 %
Date: 2026-03-15 09:23:45 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 186611
mul0r 482303
sqrs 732735
divur 2508883
divir 3502442
truedvmdsi 6202031
divrs 9872734
dbltor 13444192
int2u 25347530
dblexpo 25897362
mulrrz_int 53799215
mantissa_real 54196412
invmod2BIL 60801839
trunc2nr 62723659
invr_basecase 62846928
invr 62847517
addmulii_gen 90684337
int2n 106471919
mulsr 117514331
truedvmdis 138784587
truedvmdii 141874088
addmulii 168737379
mulss 201181563
usqrt 252795020
rtodbl 288845228
addmulii_lg3 475527425
sqrz_i 556614378
sqrr 589415863
mulsi 617517049
sqru 635681049
mulrrz_3 653043385
mulur_2 716146837
mulrrz_3end 773803664
mulur 938935957
mulir 988736647
divru 1093884268
mului 1115221857
affrr 1344564940
addmulii_inplace 1618068555
sqri 2061518525
shifti 2278689412
vals 2313546964
modii 3090152158
mulrrz_end 3558132643
mulrrz_i 3713136472
mulrr 3958355989
muluu 4654406097
mulii 21138237604

Generated by: LCOV version 1.16