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
addmulii 168734669
addmulii_gen 90676561
addmulii_inplace 1617971207
addmulii_lg3 475498630
affrr 1379004402
dblexpo 27266801
dblmantissa 0
dbltor 13464011
div0r 186609
divir 3517569
divrs 9998006
divru 1117238102
divsi 175
divsr 798
divur 2524368
int2n 106540248
int2u 25351106
int2um1 8831
invmod2BIL 60820383
invr 65130368
invr_basecase 65129878
mantissa_real 54195049
modii 3122280225
mul0r 482266
mulii 21172665247
mulir 995525511
mulrr 4040970817
mulrrz_3 658803725
mulrrz_3end 779749866
mulrrz_end 3638772101
mulrrz_i 3792992467
mulrrz_int 53799239
mulsi 617810638
mulsr 120374302
mulss 201180274
mului 1117575364
mulur 945657417
mulur_2 723029516
muluu 4657739880
rtodbl 295560686
shifti 2288624400
sqri 2079222518
sqrr 595402031
sqrs 733779
sqru 640657739
sqrz_i 561930588
truedvmdii 141918315
truedvmdis 138839375
truedvmdsi 6202031
trunc2nr 62838996
usqrt 253228643
vals 2317990548

Generated by: LCOV version 1.16