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 30851-7844d7b3a5) Lines: 532 567 93.8 %
Date: 2026-05-03 09:26:29 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 481913
sqrs 732455
divur 2455693
divir 3261898
truedvmdsi 6202318
divrs 10001372
dbltor 13394349
int2u 25350358
dblexpo 27267430
mulrrz_int 53799439
mantissa_real 54199313
invmod2BIL 60849165
trunc2nr 62836351
invr_basecase 65204700
invr 65204798
addmulii_gen 90688775
int2n 108750795
mulsr 120386011
truedvmdis 138816415
truedvmdii 141902342
addmulii 168800364
mulss 201178377
usqrt 251288923
rtodbl 295548074
addmulii_lg3 475597701
sqrz_i 562159823
sqrr 595673459
mulsi 617820821
sqru 639759467
mulrrz_3 658737977
mulur_2 722515025
mulrrz_3end 779671594
mulur 945081871
mulir 994711848
mului 1112556541
divru 1117635610
affrr 1378663512
addmulii_inplace 1617994696
sqri 2077755869
shifti 2287422430
vals 2319261494
modii 3123968394
mulrrz_end 3640331685
mulrrz_i 3792825817
mulrr 4039932578
muluu 4649837603
mulii 21153557088

Generated by: LCOV version 1.16