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
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 336632
convi 447775
pari_gmp_free 1632851
setloop 2999284
sqrtremi 5135668
xmpn_copy 7065725
floorr 7250406
truncr 8351653
diviuexact 34286606
red_montgomery 34726697
divri_with_gmp 35572336
remi2n 38693076
sqrispec_mirror 40261198
icopy_ef 42859556
absdiviu_rem 52848022
mpz2GEN 58448948
incpos 63892711
incloop 64296047
divrr_with_gmp 82045733
muliispec_mirror 86120580
divis_rem 94289476
GEN2mpz 116897896
sqrtr_abs 130773087
mantissa2nr 141577764
divrr 157741556
divri 160554137
xmpn_zero 248391156
equaliispec 310441312
int_normalize 322920366
affir 429439728
diviuexact_i 441853937
roundr_up_ip 558545545
diviiexact 561741285
xmpn_mirror 613539542
xmpn_mirrorcopy 747174198
shiftispec 762638892
adduispec_offset 775193147
sqrispec 1080611328
umodiu 1372763841
subiuspec 1872515830
dvmdii 2306777502
adduispec 2908534249
subiispec 3274742978
addiispec 3496390619
cmpiispec 4244467893
muluispec 5938473293
muliispec 6214023096

Generated by: LCOV version 2.0-1