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 30551-f8501633d1) Lines: 683 719 95.0 %
Date: 2025-11-20 09:22:21 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 200473
muluui 222712
divis 325427
convi 439591
pari_gmp_free 1755958
setloop 2999291
truncr 3460658
sqrtremi 5162235
xmpn_copy 6897190
floorr 6946877
diviuexact 31839070
red_montgomery 35054585
divri_with_gmp 35251892
remi2n 39046125
sqrispec_mirror 40038361
icopy_ef 41493806
absdiviu_rem 51010381
mpz2GEN 57763285
divrr_with_gmp 76239795
muliispec_mirror 83203926
divis_rem 86244527
incpos 103215794
incloop 103623563
GEN2mpz 115523446
sqrtr_abs 126366492
mantissa2nr 138306925
divrr 142531219
divri 151470401
xmpn_zero 237567512
equaliispec 268857332
int_normalize 307165455
affir 404262887
diviuexact_i 413255441
roundr_up_ip 518436066
diviiexact 533936808
xmpn_mirror 584348494
xmpn_mirrorcopy 713776938
shiftispec 720081181
adduispec_offset 764454519
sqrispec 1030458656
umodiu 1329170765
subiuspec 1779119183
dvmdii 2196348566
adduispec 2788229113
subiispec 3023225147
addiispec 3336720511
cmpiispec 3979482014
muluispec 5600840818
muliispec 5840297601

Generated by: LCOV version 1.16