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 30849-48ff4d246c) Lines: 532 567 93.8 %
Date: 2026-05-01 09:26:53 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 481876
sqrs 732961
divur 2455687
divir 3261897
truedvmdsi 6202318
divrs 10001225
dbltor 13393758
int2u 25350696
dblexpo 27265271
mulrrz_int 53799439
mantissa_real 54194098
invmod2BIL 60849180
trunc2nr 62828898
invr_basecase 65189214
invr 65189313
addmulii_gen 90670415
int2n 108745283
mulsr 120373701
truedvmdis 138807879
truedvmdii 141894493
addmulii 168800306
mulss 201178500
usqrt 251708404
rtodbl 295493479
addmulii_lg3 475563027
sqrz_i 562092340
sqrr 595616999
mulsi 617804307
sqru 639722433
mulrrz_3 658664419
mulur_2 722308728
mulrrz_3end 779584775
mulur 944930351
mulir 994527417
mului 1113087964
divru 1117564541
affrr 1378494496
addmulii_inplace 1617844849
sqri 2077934586
shifti 2287395090
vals 2319271928
modii 3125046976
mulrrz_end 3639850013
mulrrz_i 3792127779
mulrr 4038860493
muluu 4650662083
mulii 21154047593

Generated by: LCOV version 1.16