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 30678-a23e500d22) Lines: 535 567 94.4 %
Date: 2026-02-15 09:22:35 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 186656
mul0r 482302
sqrs 732731
divur 2508475
divir 3502242
truedvmdsi 6202031
divrs 9871455
dbltor 13386056
dblexpo 25895796
int2u 26083452
mulrrz_int 53801019
mantissa_real 54194432
invmod2BIL 60786033
trunc2nr 62687399
invr_basecase 62866438
invr 62867105
addmulii_gen 90751352
int2n 106489086
mulsr 117502853
truedvmdis 131098340
truedvmdii 134179338
addmulii 168682433
mulss 201179066
usqrt 233718469
rtodbl 288686931
addmulii_lg3 472310451
sqrz_i 556437575
sqrr 589306198
mulsi 615573458
sqru 627301650
mulrrz_3 652680778
mulur_2 706167443
mulrrz_3end 773344560
mulur 928832264
mulir 988347727
divru 1083986783
mului 1113626601
affrr 1344058389
addmulii_inplace 1578184282
sqri 1900700597
shifti 2262078159
vals 2279426963
modii 3081670692
mulrrz_end 3557701737
mulrrz_i 3711311337
mulrr 3958515198
muluu 4563378100
mulii 20951992647

Generated by: LCOV version 1.16