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 30666-e2f9826198) Lines: 683 719 95.0 %
Date: 2026-02-04 09:22:32 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 200560
muluui 222787
divis 323956
convi 439910
pari_gmp_free 1763111
setloop 2999293
truncr 3453865
sqrtremi 5128759
xmpn_copy 6836442
floorr 6944399
diviuexact 31785357
red_montgomery 34334312
divri_with_gmp 35479001
remi2n 38076520
sqrispec_mirror 40086377
icopy_ef 41527086
absdiviu_rem 51280937
mpz2GEN 57780567
divrr_with_gmp 76245185
muliispec_mirror 83360636
divis_rem 86364105
incpos 103036957
incloop 103444757
GEN2mpz 115559645
sqrtr_abs 126390410
mantissa2nr 138680453
divrr 142536970
divri 151792975
xmpn_zero 237943757
equaliispec 267853095
int_normalize 308463249
affir 405490088
diviuexact_i 413741165
roundr_up_ip 519098054
diviiexact 534651097
xmpn_mirror 586150150
shiftispec 714749782
xmpn_mirrorcopy 715531559
adduispec_offset 766303664
sqrispec 1025148513
umodiu 1329238513
subiuspec 1776811609
dvmdii 2195256329
adduispec 2788872231
subiispec 3014513089
addiispec 3332104324
cmpiispec 3972441754
muluispec 5600281181
muliispec 5829521816

Generated by: LCOV version 1.16