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 30824-18397de1d0) Lines: 683 719 95.0 %
Date: 2026-04-18 09:26:04 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 1092
pari_kernel_init 1100
incneg 66684
resetloop 174328
diviuuexact 200806
muluui 223004
divis 337095
convi 441880
pari_gmp_free 1763806
setloop 2999298
truncr 3450706
sqrtremi 5130568
xmpn_copy 6872558
floorr 6945171
diviuexact 34026577
red_montgomery 34418785
divri_with_gmp 35494573
remi2n 37881242
sqrispec_mirror 40081799
icopy_ef 42060313
absdiviu_rem 51847760
mpz2GEN 57928828
divrr_with_gmp 77907294
muliispec_mirror 83334416
incpos 87298510
incloop 87700792
divis_rem 94106647
GEN2mpz 115855279
sqrtr_abs 130491092
mantissa2nr 140989602
divrr 150345745
divri 152473152
xmpn_zero 243626426
equaliispec 307860359
int_normalize 310172691
affir 406239963
diviuexact_i 433611511
roundr_up_ip 535610136
diviiexact 553183232
xmpn_mirror 588901942
xmpn_mirrorcopy 725735517
shiftispec 739668113
adduispec_offset 766100535
sqrispec 1142203712
umodiu 1361176297
subiuspec 1822510910
dvmdii 2253435619
adduispec 2838058869
subiispec 3100469481
addiispec 3379869321
cmpiispec 4042907418
muluispec 5688969268
muliispec 5951323081

Generated by: LCOV version 1.16