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) Coverage Total Hit
Test: PARI/GP v2.19.0 lcov report (development 31092-e6893b0017) Lines: 95.0 % 718 682
Test Date: 2026-08-12 17:02:34 Functions: 96.4 % 56 54
Legend: Lines:     hit not hit

Function Name Sort by function name Hit count Sort by function hit count
addumului 0
pari_gmp_realloc 0
pari_kernel_version 4
pari_kernel_close 1092
pari_kernel_init 1100
incneg 66684
resetloop 174380
diviuuexact 200898
muluui 223122
divis 336639
convi 447819
pari_gmp_free 1632830
truncr 2530403
setloop 2999288
sqrtremi 5137701
floorr 6429873
xmpn_copy 7066577
diviuexact 34276747
red_montgomery 34732392
divri_with_gmp 35426100
remi2n 38558495
sqrispec_mirror 42195893
icopy_ef 42972810
absdiviu_rem 52875367
mpz2GEN 58509402
incpos 63969717
incloop 64373053
divrr_with_gmp 78685498
muliispec_mirror 86836601
divis_rem 94390925
GEN2mpz 117018804
sqrtr_abs 131573133
mantissa2nr 142733493
divrr 151751703
divri 161201142
xmpn_zero 245684731
equaliispec 310393166
int_normalize 322802611
affir 422150976
diviuexact_i 441874030
diviiexact 561412047
roundr_up_ip 562370950
xmpn_mirror 609296869
xmpn_mirrorcopy 742273892
shiftispec 763975675
adduispec_offset 775154827
sqrispec 1083271460
umodiu 1371445448
subiuspec 1873857482
dvmdii 2315583015
adduispec 2907990270
subiispec 3277967429
addiispec 3498093970
cmpiispec 4257388259
muluispec 5943163620
muliispec 6213086201

Generated by: LCOV version 2.0-1