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 30824-18397de1d0) Lines: 532 567 93.8 %
Date: 2026-04-19 09:25:48 Functions: 50 52 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8831
mul0r 481907
sqrs 731632
divur 2455676
divir 3261896
truedvmdsi 6202318
divrs 10001302
dbltor 13394093
int2u 25350678
dblexpo 27268515
mulrrz_int 53799439
mantissa_real 54198067
invmod2BIL 60812221
trunc2nr 62830992
invr_basecase 65197548
invr 65198608
addmulii_gen 90686349
int2n 108711533
mulsr 120371664
truedvmdis 138805264
truedvmdii 141895558
addmulii 168771694
mulss 201177168
usqrt 252381547
rtodbl 295499376
addmulii_lg3 475525455
sqrz_i 562198465
sqrr 595679093
mulsi 617816212
sqru 639633064
mulrrz_3 658763188
mulur_2 722435899
mulrrz_3end 779780903
mulur 945037177
mulir 994567673
mului 1112238807
divru 1117463695
affrr 1378603217
addmulii_inplace 1617851736
sqri 2077501532
shifti 2287319746
vals 2318755063
modii 3124248821
mulrrz_end 3639911721
mulrrz_i 3792947551
mulrr 4039608189
muluu 4649567958
mulii 21155792960

Generated by: LCOV version 1.16