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 30605-980f9eb85c) Lines: 535 567 94.4 %
Date: 2026-01-12 09:21:57 Functions: 51 52 98.1 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
dblmantissa 0
divsi 175
divsr 798
int2um1 8831
div0r 186649
mul0r 482306
sqrs 729084
divur 2508485
divir 3502226
truedvmdsi 6202031
divrs 9871249
dbltor 13384612
dblexpo 25894554
int2u 26083150
mulrrz_int 53801003
mantissa_real 54189453
invmod2BIL 60787924
trunc2nr 62675436
invr_basecase 62850117
invr 62850612
addmulii_gen 90734543
int2n 106478263
mulsr 117476122
truedvmdis 131101051
truedvmdii 134183109
addmulii 168681161
mulss 201177690
usqrt 231948338
rtodbl 288618019
addmulii_lg3 472298215
sqrz_i 556308226
sqrr 589186478
mulsi 612449981
sqru 626805833
mulrrz_3 652514626
mulur_2 706013557
mulrrz_3end 773072362
mulur 928651986
mulir 988002738
divru 1083727412
mului 1110559100
affrr 1343720950
addmulii_inplace 1578136198
sqri 1900243118
shifti 2261594242
vals 2276773455
modii 3079581372
mulrrz_end 3557571254
mulrrz_i 3710200560
mulrr 3957355940
muluu 4566471729
mulii 20968432098

Generated by: LCOV version 1.16