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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30831-19b50a36d0) Lines: 683 719 95.0 %
Date: 2026-04-21 09:26:02 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115852527
absdiviu_rem 51854670
addiispec 3379649987
adduispec 2838400097
adduispec_offset 765930692
addumului 0
affir 406074026
cmpiispec 4042489959
convi 441877
diviiexact 553078091
divis 337094
divis_rem 94044829
diviuexact 34024180
diviuexact_i 433514761
diviuuexact 200782
divri 152467818
divri_with_gmp 35494992
divrr 150310247
divrr_with_gmp 77888316
dvmdii 2253478749
equaliispec 307854105
floorr 6937124
icopy_ef 42050695
incloop 87723067
incneg 66684
incpos 87320855
int_normalize 310342071
mantissa2nr 140982607
mpz2GEN 57927588
muliispec 5949856274
muliispec_mirror 83314318
muluispec 5687713758
muluui 223015
pari_gmp_free 1763812
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34439525
remi2n 37953516
resetloop 174328
roundr_up_ip 535546750
setloop 2999299
shiftispec 739789862
sqrispec 1142662081
sqrispec_mirror 40078760
sqrtr_abs 130488235
sqrtremi 5130397
subiispec 3100336646
subiuspec 1822102138
truncr 3426311
umodiu 1361993740
xmpn_copy 6872411
xmpn_mirror 588705846
xmpn_mirrorcopy 725618300
xmpn_zero 243596351

Generated by: LCOV version 1.16