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 30548-ec77dc363d) Lines: 683 719 95.0 %
Date: 2025-11-15 09:22:38 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115527358
absdiviu_rem 50999524
addiispec 3336853006
adduispec 2787344835
adduispec_offset 764417898
addumului 0
affir 404179891
cmpiispec 3979704605
convi 439611
diviiexact 533954931
divis 325433
divis_rem 86212850
diviuexact 31841593
diviuexact_i 413277258
diviuuexact 200440
divri 151462875
divri_with_gmp 35251101
divrr 142505383
divrr_with_gmp 76222851
dvmdii 2196911786
equaliispec 268844331
floorr 6940758
icopy_ef 41484280
incloop 103666535
incneg 66684
incpos 103259482
int_normalize 306682700
mantissa2nr 138305593
mpz2GEN 57765204
muliispec 5839780154
muliispec_mirror 83221547
muluispec 5600652790
muluui 222679
pari_gmp_free 1755949
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35079683
remi2n 39056239
resetloop 174328
roundr_up_ip 518407854
setloop 2999290
shiftispec 720206763
sqrispec 1030505339
sqrispec_mirror 40033785
sqrtr_abs 126362218
sqrtremi 5161943
subiispec 3023240502
subiuspec 1779131899
truncr 3442142
umodiu 1328294909
xmpn_copy 6897305
xmpn_mirror 584279174
xmpn_mirrorcopy 713759421
xmpn_zero 237555690

Generated by: LCOV version 1.16