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 30759-17b423fb9b) Lines: 535 567 94.4 %
Date: 2026-03-21 09:26:11 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 186609
mul0r 482266
sqrs 733779
divur 2524368
divir 3517569
truedvmdsi 6202031
divrs 9998006
dbltor 13464011
int2u 25351106
dblexpo 27266801
mulrrz_int 53799239
mantissa_real 54195049
invmod2BIL 60820383
trunc2nr 62838996
invr_basecase 65129878
invr 65130368
addmulii_gen 90676561
int2n 106540248
mulsr 120374302
truedvmdis 138839375
truedvmdii 141918315
addmulii 168734669
mulss 201180274
usqrt 253228643
rtodbl 295560686
addmulii_lg3 475498630
sqrz_i 561930588
sqrr 595402031
mulsi 617810638
sqru 640657739
mulrrz_3 658803725
mulur_2 723029516
mulrrz_3end 779749866
mulur 945657417
mulir 995525511
divru 1117238102
mului 1117575364
affrr 1379004402
addmulii_inplace 1617971207
sqri 2079222518
shifti 2288624400
vals 2317990548
modii 3122280225
mulrrz_end 3638772101
mulrrz_i 3792992467
mulrr 4040970817
muluu 4657739880
mulii 21172665247

Generated by: LCOV version 1.16