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

Generated by: LCOV version 2.0-1