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
GEN2mpz 114514698
absdiviu_rem 50046485
addiispec 3279546147
adduispec 2726766173
adduispec_offset 739137220
addumului 0
affir 388188241
cmpiispec 3888648578
convi 438776
diviiexact 522842593
divis 320944
divis_rem 84790759
diviuexact 31674814
diviuexact_i 403999509
diviuuexact 200464
divri 150692766
divri_with_gmp 35166530
divrr 135719005
divrr_with_gmp 72001360
dvmdii 2151219444
equaliispec 265646580
floorr 6756596
icopy_ef 40993482
incloop 103438651
incneg 66684
incpos 103031823
int_normalize 297452987
mantissa2nr 129084342
mpz2GEN 57260512
muliispec 5723981207
muliispec_mirror 82596245
muluispec 5490009373
muluui 222713
pari_gmp_free 1761751
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34174228
remi2n 37193615
resetloop 174328
roundr_up_ip 507092369
setloop 2999293
shiftispec 688502400
sqrispec 1006305012
sqrispec_mirror 38475362
sqrtr_abs 117908007
sqrtremi 4961951
subiispec 2951930068
subiuspec 1732295548
truncr 3309941
umodiu 1268198707
xmpn_copy 6706799
xmpn_mirror 560772080
xmpn_mirrorcopy 686407603
xmpn_zero 224947588

Generated by: LCOV version 1.16