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

Generated by: LCOV version 1.16