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

Generated by: LCOV version 1.16