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 30831-19b50a36d0) Lines: 532 567 93.8 %
Date: 2026-04-21 09:26:02 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 481880
sqrs 733057
divur 2455671
divir 3261898
truedvmdsi 6202318
divrs 10001282
dbltor 13393902
int2u 25350359
dblexpo 27267436
mulrrz_int 53799439
mantissa_real 54191166
invmod2BIL 60812219
trunc2nr 62829663
invr_basecase 65165130
invr 65166137
addmulii_gen 90640541
int2n 108709674
mulsr 120379380
truedvmdis 138765621
truedvmdii 141854357
addmulii 168770341
mulss 201178849
usqrt 251894339
rtodbl 295445957
addmulii_lg3 475514585
sqrz_i 562058370
sqrr 595588492
mulsi 617733007
sqru 639621296
mulrrz_3 658724455
mulur_2 722353140
mulrrz_3end 779732901
mulur 944922133
mulir 994454004
mului 1112721061
divru 1117280333
affrr 1378388307
addmulii_inplace 1617822459
sqri 2078001598
shifti 2287615662
vals 2318426831
modii 3124768097
mulrrz_end 3639572293
mulrrz_i 3792283100
mulrr 4040709109
muluu 4649638043
mulii 21155606664

Generated by: LCOV version 1.16