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

Generated by: LCOV version 1.16