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
addmulii 168707422
addmulii_gen 90750272
addmulii_inplace 1618043584
addmulii_lg3 475395244
affrr 1344594056
dblexpo 25895842
dblmantissa 0
dbltor 13437463
div0r 186647
divir 3502230
divrs 9871418
divru 1093916699
divsi 175
divsr 798
divur 2508450
int2n 106485477
int2u 25347661
int2um1 8831
invmod2BIL 60803543
invr 62858863
invr_basecase 62858446
mantissa_real 54189766
modii 3092013783
mul0r 482314
mulii 21099771499
mulir 988841660
mulrr 3959090534
mulrrz_3 653123667
mulrrz_3end 773934084
mulrrz_end 3558477782
mulrrz_i 3714359743
mulrrz_int 53801019
mulsi 617595180
mulsr 117505552
mulss 201181176
mului 1116564098
mulur 939052820
mulur_2 716239288
muluu 4656745914
rtodbl 288815756
shifti 2277083267
sqri 1934293592
sqrr 589247173
sqrs 734286
sqru 635556383
sqrz_i 556568997
truedvmdii 141884688
truedvmdis 138802896
truedvmdsi 6202031
trunc2nr 62684933
usqrt 252974683
vals 2314174808

Generated by: LCOV version 1.16