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 30634-7c77b4d1a9) Lines: 683 719 95.0 %
Date: 2026-01-25 09:23:13 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 200487
muluui 222735
divis 323929
convi 439846
pari_gmp_free 1763106
setloop 2999292
truncr 3435937
sqrtremi 5128711
xmpn_copy 6836245
floorr 6935594
diviuexact 31784920
red_montgomery 34321375
divri_with_gmp 35477099
remi2n 38040852
sqrispec_mirror 40088241
icopy_ef 41516053
absdiviu_rem 51274082
mpz2GEN 57768435
divrr_with_gmp 76224768
muliispec_mirror 83292337
divis_rem 86351468
incpos 102967775
incloop 103373254
GEN2mpz 115534524
sqrtr_abs 126367075
mantissa2nr 138639459
divrr 142510026
divri 151784215
xmpn_zero 237843506
equaliispec 267833272
int_normalize 308995259
affir 405062109
diviuexact_i 413629170
roundr_up_ip 519020005
diviiexact 534523194
xmpn_mirror 585625799
shiftispec 714290375
xmpn_mirrorcopy 714960433
adduispec_offset 765190261
sqrispec 1024671130
umodiu 1331228400
subiuspec 1775552410
dvmdii 2193910805
adduispec 2788268726
subiispec 3011817628
addiispec 3330375524
cmpiispec 3969214579
muluispec 5593827792
muliispec 5824237989

Generated by: LCOV version 1.16