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-15 09:23:45 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 200542
muluui 222753
divis 323970
convi 440674
pari_gmp_free 1762585
setloop 2999286
truncr 3452177
sqrtremi 5129430
xmpn_copy 6854689
floorr 6944476
diviuexact 34101131
red_montgomery 34419748
divri_with_gmp 35480573
remi2n 38004717
sqrispec_mirror 40105035
icopy_ef 41510194
absdiviu_rem 51318977
mpz2GEN 57774496
divrr_with_gmp 76245301
muliispec_mirror 83246318
incpos 87013928
incloop 87405843
divis_rem 94068503
GEN2mpz 115546876
sqrtr_abs 126396493
mantissa2nr 138710862
divrr 142561395
divri 151798255
xmpn_zero 237964728
equaliispec 266953283
int_normalize 309026440
affir 405528529
diviuexact_i 431286026
roundr_up_ip 528720226
diviiexact 550565729
xmpn_mirror 586111588
xmpn_mirrorcopy 715465437
shiftispec 737924277
adduispec_offset 765755614
sqrispec 1131197189
umodiu 1349148057
subiuspec 1815751122
dvmdii 2213303225
adduispec 2833799216
subiispec 3057851867
addiispec 3375469381
cmpiispec 4012277026
muluispec 5693283597
muliispec 5923845097

Generated by: LCOV version 1.16