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
GEN2mpz 115526665
absdiviu_rem 51013056
addiispec 3336835078
adduispec 2789957865
adduispec_offset 764830941
addumului 0
affir 404128457
cmpiispec 3980171475
convi 439471
diviiexact 533862633
divis 325429
divis_rem 86215384
diviuexact 31841418
diviuexact_i 413148602
diviuuexact 200466
divri 151448908
divri_with_gmp 35251062
divrr 142481369
divrr_with_gmp 76211139
dvmdii 2197693649
equaliispec 268844637
floorr 6937613
icopy_ef 41482498
incloop 103731194
incneg 66684
incpos 103319683
int_normalize 306812330
mantissa2nr 138307846
mpz2GEN 57764600
muliispec 5841214867
muliispec_mirror 83262597
muluispec 5601351431
muluui 222724
pari_gmp_free 1755948
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 35056846
remi2n 39166922
resetloop 174328
roundr_up_ip 518372703
setloop 2999289
shiftispec 720155213
sqrispec 1030662712
sqrispec_mirror 40055119
sqrtr_abs 126362604
sqrtremi 5161859
subiispec 3023414608
subiuspec 1779006831
truncr 3434116
umodiu 1330973656
xmpn_copy 6897239
xmpn_mirror 584315289
xmpn_mirrorcopy 713871883
xmpn_zero 237560405

Generated by: LCOV version 1.16