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 30616-7aa4fb0184) Lines: 683 719 95.0 %
Date: 2026-01-18 09:22:29 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 200464
muluui 222706
divis 323939
convi 439565
pari_gmp_free 1762883
setloop 2999295
truncr 3437857
sqrtremi 5128736
xmpn_copy 6836295
floorr 6940861
diviuexact 31782573
red_montgomery 34395351
divri_with_gmp 35477880
remi2n 37948316
sqrispec_mirror 40078406
icopy_ef 41515571
absdiviu_rem 51271600
mpz2GEN 57768429
divrr_with_gmp 76227822
muliispec_mirror 83273598
divis_rem 86340313
incpos 103501443
incloop 103907533
GEN2mpz 115534474
sqrtr_abs 126369334
mantissa2nr 138632400
divrr 142517841
divri 151784157
xmpn_zero 237790822
equaliispec 267829943
int_normalize 308933499
affir 404971991
diviuexact_i 413454306
roundr_up_ip 518649349
diviiexact 534317257
xmpn_mirror 585227114
shiftispec 713696257
xmpn_mirrorcopy 714631351
adduispec_offset 764090962
sqrispec 1024717487
umodiu 1329047269
subiuspec 1778300348
dvmdii 2192102989
adduispec 2786531749
subiispec 3017813160
addiispec 3332841423
cmpiispec 3974778174
muluispec 5603058372
muliispec 5834177954

Generated by: LCOV version 1.16