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 30702-bddb8d6928) Lines: 535 567 94.4 %
Date: 2026-02-23 02:23:56 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 150
divsr 680
int2um1 7447
div0r 152688
mul0r 405178
sqrs 635354
divur 1944626
divir 2667853
truedvmdsi 5316014
divrs 8262268
dbltor 11274397
int2u 20761270
dblexpo 21412752
mantissa_real 44753829
invr 52062923
invr_basecase 52062923
trunc2nr 52959743
mulrrz_int 53706625
invmod2BIL 55165468
addmulii_gen 72776640
int2n 87852483
mulsr 98183108
truedvmdis 104332739
truedvmdii 106814362
addmulii 134483301
mulss 172441190
usqrt 192011361
rtodbl 235978792
addmulii_lg3 385342932
sqrz_i 465563727
sqrr 491579947
mulsi 514415870
sqru 536365353
mulrrz_3 536666182
mulur_2 593606292
mulrrz_3end 636333303
mulur 781248750
mulir 837392732
divru 911268275
mului 953371262
affrr 1130004255
addmulii_inplace 1275251641
sqri 1439252366
vals 1874311080
shifti 1876731174
modii 2492116106
mulrrz_end 2965498988
mulrrz_i 3092477067
mulrr 3295818051
muluu 3372500362
mulii 17472526810

Generated by: LCOV version 1.16