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 30660-09c6d0ed2e) Lines: 683 719 95.0 %
Date: 2026-02-01 09:23:44 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 200508
muluui 222708
divis 323940
convi 439877
pari_gmp_free 1763116
setloop 2999292
truncr 3463134
sqrtremi 5128822
xmpn_copy 6836548
floorr 6948733
diviuexact 31786696
red_montgomery 34366742
divri_with_gmp 35478897
remi2n 38124209
sqrispec_mirror 40102112
icopy_ef 41528395
absdiviu_rem 51265510
mpz2GEN 57774965
divrr_with_gmp 76256309
muliispec_mirror 83385305
divis_rem 86383841
incpos 103382594
incloop 103783904
GEN2mpz 115547830
sqrtr_abs 126391859
mantissa2nr 138689622
divrr 142574189
divri 151796854
xmpn_zero 237949816
equaliispec 267847736
int_normalize 308872186
affir 405485740
diviuexact_i 413873269
roundr_up_ip 519484093
diviiexact 534760667
xmpn_mirror 586313762
shiftispec 714880777
xmpn_mirrorcopy 715505479
adduispec_offset 766216839
sqrispec 1025035495
umodiu 1333713943
subiuspec 1776591427
dvmdii 2195828531
adduispec 2792899649
subiispec 3014378070
addiispec 3332463763
cmpiispec 3972580532
muluispec 5603048495
muliispec 5833928640

Generated by: LCOV version 1.16