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-10-05 17:03:00 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 117011290
absdiviu_rem 52881014
addiispec 3497535823
adduispec 2909709278
adduispec_offset 775132457
addumului 0
affir 422132020
cmpiispec 4255603120
convi 447822
diviiexact 561314013
divis 336637
divis_rem 94336214
diviuexact 34275301
diviuexact_i 441778497
diviuuexact 200898
divri 161195201
divri_with_gmp 35425133
divrr 151745915
divrr_with_gmp 78683971
dvmdii 2314569288
equaliispec 310386490
floorr 6429991
icopy_ef 42964704
incloop 64240925
incneg 66684
incpos 63837588
int_normalize 322794154
mantissa2nr 142719698
mpz2GEN 58505645
muliispec 6212361708
muliispec_mirror 86836573
muluispec 5942437758
muluui 223122
pari_gmp_free 1632821
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34733288
remi2n 38557328
resetloop 174380
roundr_up_ip 562331930
setloop 2999288
shiftispec 763690065
sqrispec 1082696002
sqrispec_mirror 42195509
sqrtr_abs 131569852
sqrtremi 5137759
subiispec 3276879497
subiuspec 1873676688
truncr 2530448
umodiu 1373394162
xmpn_copy 7066368
xmpn_mirror 609246512
xmpn_mirrorcopy 742254016
xmpn_zero 245678956

Generated by: LCOV version 2.0-1