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) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30735-65f72320ad) Lines: 683 719 95.0 %
Date: 2026-03-12 09:23:43 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1084
pari_kernel_init 1092
incneg 66684
resetloop 174328
diviuuexact 200589
muluui 222809
divis 323967
convi 440683
pari_gmp_free 1762597
setloop 2999283
truncr 3448798
sqrtremi 5129532
xmpn_copy 6854588
floorr 6942980
diviuexact 34100001
red_montgomery 34417053
divri_with_gmp 35480658
remi2n 38059574
sqrispec_mirror 40117417
icopy_ef 41511181
absdiviu_rem 51321012
mpz2GEN 57777656
divrr_with_gmp 76239627
muliispec_mirror 83369211
incpos 87116939
incloop 87517241
divis_rem 94060755
GEN2mpz 115553331
sqrtr_abs 126390719
mantissa2nr 138708205
divrr 142550929
divri 151796793
xmpn_zero 237955852
equaliispec 266952908
int_normalize 308925846
affir 405586342
diviuexact_i 431243673
roundr_up_ip 528681619
diviiexact 550525251
xmpn_mirror 586207643
xmpn_mirrorcopy 715617101
shiftispec 738104031
adduispec_offset 765909939
sqrispec 1131506607
umodiu 1348098940
subiuspec 1815690301
dvmdii 2214053189
adduispec 2832429422
subiispec 3058531996
addiispec 3375740879
cmpiispec 4013081923
muluispec 5693376405
muliispec 5924281300

Generated by: LCOV version 1.16