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 30107-5d3c5ac62a) Lines: 683 719 95.0 %
Date: 2025-04-01 09:20:36 Functions: 54 56 96.4 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
GEN2mpz 115181476
absdiviu_rem 109379925
addiispec 3312150766
adduispec 2772795654
adduispec_offset 764905645
addumului 0
affir 401143545
cmpiispec 3937975758
convi 438293
diviiexact 522931388
divis 966293
divis_rem 85216639
diviuexact 38819849
diviuexact_i 410630815
diviuuexact 200476
divri 150499632
divri_with_gmp 35194855
divrr 141813329
divrr_with_gmp 75735637
dvmdii 2173607263
equaliispec 265912283
floorr 6975213
icopy_ef 41067867
incloop 103577255
incneg 66684
incpos 103166841
int_normalize 306699528
mantissa2nr 137222395
mpz2GEN 57592016
muliispec 5874451328
muliispec_mirror 84426085
muluispec 5539618920
muluui 222704
pari_gmp_free 1758365
pari_gmp_realloc 0
pari_kernel_close 1100
pari_kernel_init 1108
pari_kernel_version 4
red_montgomery 33653827
remi2n 35315193
resetloop 174328
roundr_up_ip 522046200
setloop 2997597
shiftispec 702235042
sqrispec 1016593759
sqrispec_mirror 41381916
sqrtr_abs 125186215
sqrtremi 5114309
subiispec 2999572432
subiuspec 1766800718
truncr 3531984
umodiu 1302922456
xmpn_copy 6706360
xmpn_mirror 584016251
xmpn_mirrorcopy 713752577
xmpn_zero 235879514

Generated by: LCOV version 1.16