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 30540-a74e376001) Lines: 683 719 95.0 %
Date: 2025-11-09 09:22:50 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 200466
muluui 222724
divis 325429
convi 439471
pari_gmp_free 1755948
setloop 2999289
truncr 3434116
sqrtremi 5161859
xmpn_copy 6897239
floorr 6937613
diviuexact 31841418
red_montgomery 35056846
divri_with_gmp 35251062
remi2n 39166922
sqrispec_mirror 40055119
icopy_ef 41482498
absdiviu_rem 51013056
mpz2GEN 57764600
divrr_with_gmp 76211139
muliispec_mirror 83262597
divis_rem 86215384
incpos 103319683
incloop 103731194
GEN2mpz 115526665
sqrtr_abs 126362604
mantissa2nr 138307846
divrr 142481369
divri 151448908
xmpn_zero 237560405
equaliispec 268844637
int_normalize 306812330
affir 404128457
diviuexact_i 413148602
roundr_up_ip 518372703
diviiexact 533862633
xmpn_mirror 584315289
xmpn_mirrorcopy 713871883
shiftispec 720155213
adduispec_offset 764830941
sqrispec 1030662712
umodiu 1330973656
subiuspec 1779006831
dvmdii 2197693649
adduispec 2789957865
subiispec 3023414608
addiispec 3336835078
cmpiispec 3980171475
muluispec 5601351431
muliispec 5841214867

Generated by: LCOV version 1.16