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 30571-c0dfe82732) Lines: 683 719 95.0 %
Date: 2025-12-07 09:22:06 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115614445
absdiviu_rem 51104244
addiispec 3338031007
adduispec 2791335648
adduispec_offset 764652047
addumului 0
affir 404392461
cmpiispec 3982721755
convi 439755
diviiexact 534622357
divis 325449
divis_rem 86348286
diviuexact 31839106
diviuexact_i 413737022
diviuuexact 200477
divri 151540620
divri_with_gmp 35250956
divrr 142528082
divrr_with_gmp 76240143
dvmdii 2198299299
equaliispec 268865662
floorr 6942854
icopy_ef 41498667
incloop 103692037
incneg 66684
incpos 103288245
int_normalize 307152015
mantissa2nr 138412078
mpz2GEN 57808500
muliispec 5845098189
muliispec_mirror 83344293
muluispec 5606317617
muluui 222703
pari_gmp_free 1755987
pari_gmp_realloc 0
pari_kernel_close 1104
pari_kernel_init 1112
pari_kernel_version 4
red_montgomery 34984938
remi2n 39182793
resetloop 174328
roundr_up_ip 518715121
setloop 2999293
shiftispec 720394148
sqrispec 1030546983
sqrispec_mirror 40083242
sqrtr_abs 126390182
sqrtremi 5162703
subiispec 3024584551
subiuspec 1780187356
truncr 3443787
umodiu 1330142227
xmpn_copy 6897294
xmpn_mirror 584682211
xmpn_mirrorcopy 714089037
xmpn_zero 237606024

Generated by: LCOV version 1.16