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 30568-0d72d66ef5) Lines: 683 719 95.0 %
Date: 2025-12-01 09:22:22 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115610600
absdiviu_rem 51105711
addiispec 3338021299
adduispec 2788351291
adduispec_offset 764471452
addumului 0
affir 404347689
cmpiispec 3983616473
convi 439764
diviiexact 534693446
divis 325453
divis_rem 86347887
diviuexact 31839928
diviuexact_i 413827963
diviuuexact 200476
divri 151539758
divri_with_gmp 35251951
divrr 142519050
divrr_with_gmp 76232876
dvmdii 2197737932
equaliispec 268861552
floorr 6938935
icopy_ef 41494745
incloop 103795060
incneg 66684
incpos 103394595
int_normalize 307136868
mantissa2nr 138412375
mpz2GEN 57806510
muliispec 5842835119
muliispec_mirror 83347412
muluispec 5604011382
muluui 222699
pari_gmp_free 1755994
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34909956
remi2n 39164939
resetloop 174328
roundr_up_ip 518653211
setloop 2999291
shiftispec 720463539
sqrispec 1030861454
sqrispec_mirror 40081841
sqrtr_abs 126388700
sqrtremi 5162690
subiispec 3025344795
subiuspec 1780250294
truncr 3435049
umodiu 1327200820
xmpn_copy 6897305
xmpn_mirror 584614283
xmpn_mirrorcopy 714003817
xmpn_zero 237594780

Generated by: LCOV version 1.16