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 31057-89c4d54ba6) Lines: 95.0 % 718 682
Test Date: 2026-07-25 17:02:42 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 116909688
absdiviu_rem 52845194
addiispec 3497110026
adduispec 2907881909
adduispec_offset 775087250
addumului 0
affir 429682630
cmpiispec 4245786792
convi 447775
diviiexact 561721427
divis 336626
divis_rem 94295940
diviuexact 34286316
diviuexact_i 441813933
diviuuexact 200898
divri 160561654
divri_with_gmp 35573170
divrr 157773163
divrr_with_gmp 82068594
dvmdii 2307062153
equaliispec 310449157
floorr 7255705
icopy_ef 42870236
incloop 64338824
incneg 66684
incpos 63935488
int_normalize 322774996
mantissa2nr 141584879
mpz2GEN 58454844
muliispec 6214414715
muliispec_mirror 86120606
muluispec 5939052980
muluui 223122
pari_gmp_free 1632860
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34720092
remi2n 38532389
resetloop 174380
roundr_up_ip 558593702
setloop 2999288
shiftispec 762728605
sqrispec 1080948020
sqrispec_mirror 40261612
sqrtr_abs 130773814
sqrtremi 5135597
subiispec 3275797010
subiuspec 1872826641
truncr 8374320
umodiu 1371765140
xmpn_copy 7066552
xmpn_mirror 613771957
xmpn_mirrorcopy 747251588
xmpn_zero 248415578

Generated by: LCOV version 2.0-1