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 30775-9d8a55740a) Lines: 683 719 95.0 %
Date: 2026-04-06 09:26:18 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 1088
pari_kernel_init 1096
incneg 66684
resetloop 174328
diviuuexact 200782
muluui 223004
divis 337096
convi 441876
pari_gmp_free 1763209
setloop 2999290
truncr 3452033
sqrtremi 5130263
xmpn_copy 6872161
floorr 6946630
diviuexact 34099082
red_montgomery 34478558
divri_with_gmp 35490518
remi2n 37882804
sqrispec_mirror 40080734
icopy_ef 41996633
absdiviu_rem 51840704
mpz2GEN 57905435
divrr_with_gmp 77868396
muliispec_mirror 83307702
incpos 87183964
incloop 87588813
divis_rem 94063979
GEN2mpz 115808380
sqrtr_abs 130340852
mantissa2nr 140900841
divrr 150245927
divri 152454903
xmpn_zero 243434124
equaliispec 307108954
int_normalize 309830545
affir 406190466
diviuexact_i 431893333
roundr_up_ip 535655464
diviiexact 551363496
xmpn_mirror 588702087
xmpn_mirrorcopy 725322089
shiftispec 739169937
adduispec_offset 765024253
sqrispec 1142829002
umodiu 1359779968
subiuspec 1821459372
dvmdii 2253571682
adduispec 2834648494
subiispec 3099903124
addiispec 3379778611
cmpiispec 4040182593
muluispec 5685764950
muliispec 5947461419

Generated by: LCOV version 1.16