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/gmp - mp.c (source / functions) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 95.0 % 718 682
Test Date: 2026-11-12 17:03:01 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117020690
absdiviu_rem 52896239
addiispec 3498150508
adduispec 2909361376
adduispec_offset 775237788
addumului 0
affir 422187550
cmpiispec 4257260045
convi 447824
diviiexact 561422207
divis 336639
divis_rem 94398253
diviuexact 34277587
diviuexact_i 441881924
diviuuexact 200898
divri 161200497
divri_with_gmp 35425596
divrr 151748814
divrr_with_gmp 78684212
dvmdii 2315586896
equaliispec 310392810
floorr 6429978
icopy_ef 42976044
incloop 64294941
incneg 66684
incpos 63891605
int_normalize 322836460
mantissa2nr 142732733
mpz2GEN 58510345
muliispec 6213362889
muliispec_mirror 86836573
muluispec 5943453121
muluui 223122
pari_gmp_free 1632820
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34728359
remi2n 38604581
resetloop 174380
roundr_up_ip 562369823
setloop 2999288
shiftispec 763934928
sqrispec 1083144342
sqrispec_mirror 42195476
sqrtr_abs 131571087
sqrtremi 5137840
subiispec 3277985341
subiuspec 1873944463
truncr 2530487
umodiu 1372830746
xmpn_copy 7067280
xmpn_mirror 609321638
xmpn_mirrorcopy 742269240
xmpn_zero 245680895

Generated by: LCOV version 2.0-1