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 30613-2b070936c6) Lines: 683 719 95.0 %
Date: 2026-01-15 09:21:54 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115542187
absdiviu_rem 51266294
addiispec 3332075781
adduispec 2787603325
adduispec_offset 764965415
addumului 0
affir 405094717
cmpiispec 3974574580
convi 439580
diviiexact 534417657
divis 323936
divis_rem 86352359
diviuexact 31783055
diviuexact_i 413525072
diviuuexact 200490
divri 151787300
divri_with_gmp 35477469
divrr 142514325
divrr_with_gmp 76231719
dvmdii 2192017445
equaliispec 267836128
floorr 6942502
icopy_ef 41522592
incloop 103929279
incneg 66684
incpos 103525676
int_normalize 308334916
mantissa2nr 138653413
mpz2GEN 57772261
muliispec 5836709210
muliispec_mirror 83250840
muluispec 5604676648
muluui 222720
pari_gmp_free 1762892
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34381546
remi2n 37991266
resetloop 174328
roundr_up_ip 518862958
setloop 2999291
shiftispec 713981218
sqrispec 1023875091
sqrispec_mirror 40101785
sqrtr_abs 126371975
sqrtremi 5128722
subiispec 3016767962
subiuspec 1778499822
truncr 3445310
umodiu 1329037432
xmpn_copy 6836374
xmpn_mirror 585431852
xmpn_mirrorcopy 714953836
xmpn_zero 237881624

Generated by: LCOV version 1.16