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/none - mp_indep.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30552-d1d0643eee) Lines: 535 567 94.4 %
Date: 2025-11-21 09:22:16 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
divsi 175
divsr 798
int2um1 8831
div0r 187458
mul0r 482284
sqrs 730938
divur 2509307
divir 3503622
truedvmdsi 6202031
divrs 9871044
dbltor 13388845
dblexpo 25890985
int2u 26156135
mantissa_real 53608815
mulrrz_int 53800761
invmod2BIL 60743975
trunc2nr 62692715
invr_basecase 62835186
invr 62835623
addmulii_gen 90730567
int2n 105935752
mulsr 117490748
truedvmdis 130858683
truedvmdii 133938852
addmulii 168641017
mulss 201177464
usqrt 231828160
rtodbl 288915801
addmulii_lg3 472699273
sqrz_i 555600926
sqrr 588478198
mulsi 609228689
sqru 626946269
mulrrz_3 652529502
mulur_2 704520033
mulrrz_3end 773127981
mulur 927029583
mulir 985762000
divru 1083590226
mului 1107167264
affrr 1343119029
addmulii_inplace 1581244014
sqri 1911698410
vals 2266973085
shifti 2268966721
modii 3083022915
mulrrz_end 3555300948
mulrrz_i 3708925306
mulrr 3955534464
muluu 4561369012
mulii 20969182807

Generated by: LCOV version 1.16