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 30622-caa25a75db) Lines: 683 719 95.0 %
Date: 2026-01-22 09:18:00 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 200464
muluui 222713
divis 320944
convi 438776
pari_gmp_free 1761751
setloop 2999293
truncr 3309941
sqrtremi 4961951
xmpn_copy 6706799
floorr 6756596
diviuexact 31674814
red_montgomery 34174228
divri_with_gmp 35166530
remi2n 37193615
sqrispec_mirror 38475362
icopy_ef 40993482
absdiviu_rem 50046485
mpz2GEN 57260512
divrr_with_gmp 72001360
muliispec_mirror 82596245
divis_rem 84790759
incpos 103031823
incloop 103438651
GEN2mpz 114514698
sqrtr_abs 117908007
mantissa2nr 129084342
divrr 135719005
divri 150692766
xmpn_zero 224947588
equaliispec 265646580
int_normalize 297452987
affir 388188241
diviuexact_i 403999509
roundr_up_ip 507092369
diviiexact 522842593
xmpn_mirror 560772080
xmpn_mirrorcopy 686407603
shiftispec 688502400
adduispec_offset 739137220
sqrispec 1006305012
umodiu 1268198707
subiuspec 1732295548
dvmdii 2151219444
adduispec 2726766173
subiispec 2951930068
addiispec 3279546147
cmpiispec 3888648578
muluispec 5490009373
muliispec 5723981207

Generated by: LCOV version 1.16