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 30605-980f9eb85c) Lines: 535 567 94.4 %
Date: 2026-01-11 09:21:30 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addmulii 168696902
addmulii_gen 90738858
addmulii_inplace 1578200821
addmulii_lg3 472344534
affrr 1343595995
dblexpo 25892758
dblmantissa 0
dbltor 13385131
div0r 186650
divir 3502232
divrs 9871364
divru 1083644322
divsi 175
divsr 798
divur 2508478
int2n 106481799
int2u 26083321
int2um1 8831
invmod2BIL 60787938
invr 62851673
invr_basecase 62851314
mantissa_real 54188835
modii 3079594100
mul0r 482313
mulii 20967277886
mulir 987825867
mulrr 3957440321
mulrrz_3 652512042
mulrrz_3end 773064965
mulrrz_end 3557560367
mulrrz_i 3710022990
mulrrz_int 53801003
mulsi 612467772
mulsr 117481345
mulss 201178336
mului 1111697079
mulur 928558267
mulur_2 705930595
muluu 4566193653
rtodbl 288653787
shifti 2261720647
sqri 1899990892
sqrr 589158700
sqrs 732166
sqru 626840473
sqrz_i 556261125
truedvmdii 134190923
truedvmdis 131108508
truedvmdsi 6202031
trunc2nr 62680422
usqrt 231659855
vals 2276851782

Generated by: LCOV version 1.16