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.18.1 lcov report (development 31042-0fbe168e69) Lines: 95.0 % 718 682
Test Date: 2026-07-23 17:04:59 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
GEN2mpz 116897896
absdiviu_rem 52848022
addiispec 3496390619
adduispec 2908534249
adduispec_offset 775193147
addumului 0
affir 429439728
cmpiispec 4244467893
convi 447775
diviiexact 561741285
divis 336632
divis_rem 94289476
diviuexact 34286606
diviuexact_i 441853937
diviuuexact 200898
divri 160554137
divri_with_gmp 35572336
divrr 157741556
divrr_with_gmp 82045733
dvmdii 2306777502
equaliispec 310441312
floorr 7250406
icopy_ef 42859556
incloop 64296047
incneg 66684
incpos 63892711
int_normalize 322920366
mantissa2nr 141577764
mpz2GEN 58448948
muliispec 6214023096
muliispec_mirror 86120580
muluispec 5938473293
muluui 223122
pari_gmp_free 1632851
pari_gmp_realloc 0
pari_kernel_close 1092
pari_kernel_init 1100
pari_kernel_version 4
red_montgomery 34726697
remi2n 38693076
resetloop 174380
roundr_up_ip 558545545
setloop 2999284
shiftispec 762638892
sqrispec 1080611328
sqrispec_mirror 40261198
sqrtr_abs 130773087
sqrtremi 5135668
subiispec 3274742978
subiuspec 1872515830
truncr 8351653
umodiu 1372763841
xmpn_copy 7065725
xmpn_mirror 613539542
xmpn_mirrorcopy 747174198
xmpn_zero 248391156

Generated by: LCOV version 2.0-1