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 30719-2b7f142d49) Lines: 535 567 94.4 %
Date: 2026-02-28 09:24:01 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 186647
mul0r 482314
sqrs 734286
divur 2508450
divir 3502230
truedvmdsi 6202031
divrs 9871418
dbltor 13437463
int2u 25347661
dblexpo 25895842
mulrrz_int 53801019
mantissa_real 54189766
invmod2BIL 60803543
trunc2nr 62684933
invr_basecase 62858446
invr 62858863
addmulii_gen 90750272
int2n 106485477
mulsr 117505552
truedvmdis 138802896
truedvmdii 141884688
addmulii 168707422
mulss 201181176
usqrt 252974683
rtodbl 288815756
addmulii_lg3 475395244
sqrz_i 556568997
sqrr 589247173
mulsi 617595180
sqru 635556383
mulrrz_3 653123667
mulur_2 716239288
mulrrz_3end 773934084
mulur 939052820
mulir 988841660
divru 1093916699
mului 1116564098
affrr 1344594056
addmulii_inplace 1618043584
sqri 1934293592
shifti 2277083267
vals 2314174808
modii 3092013783
mulrrz_end 3558477782
mulrrz_i 3714359743
mulrr 3959090534
muluu 4656745914
mulii 21099771499

Generated by: LCOV version 1.16