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 30838-aa3635ec72) Lines: 532 567 93.8 %
Date: 2026-04-28 09:25:50 Functions: 50 52 96.2 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
div0r 0
divsi 175
divsr 798
int2um1 8831
mul0r 481895
sqrs 731604
divur 2455677
divir 3261901
truedvmdsi 6202318
divrs 10001287
dbltor 13393788
int2u 25350374
dblexpo 27261999
mulrrz_int 53799439
mantissa_real 54194434
invmod2BIL 60815502
trunc2nr 62831888
invr_basecase 65189684
invr 65189746
addmulii_gen 90671830
int2n 108706835
mulsr 120354189
truedvmdis 138797640
truedvmdii 141882983
addmulii 168772180
mulss 201176946
usqrt 251416220
rtodbl 295504616
addmulii_lg3 475523540
sqrz_i 562093977
sqrr 595644450
mulsi 617795752
sqru 639649663
mulrrz_3 658717960
mulur_2 722082492
mulrrz_3end 779641877
mulur 944594815
mulir 994167349
mului 1111363093
divru 1117310263
affrr 1378176447
addmulii_inplace 1617794286
sqri 2077860390
shifti 2287147178
vals 2318331516
modii 3123180100
mulrrz_end 3640033989
mulrrz_i 3791257654
mulrr 4038964233
muluu 4641453719
mulii 21141271035

Generated by: LCOV version 1.16