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 30835-e55edf4b45) Lines: 532 567 93.8 %
Date: 2026-04-26 09:26:37 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 481917
sqrs 733078
divur 2455666
divir 3261895
truedvmdsi 6202318
divrs 10001336
dbltor 13393610
int2u 25349943
dblexpo 27266159
mulrrz_int 53799439
mantissa_real 54194603
invmod2BIL 60812213
trunc2nr 62833561
invr_basecase 65188706
invr 65188965
addmulii_gen 90669721
int2n 108709293
mulsr 120371509
truedvmdis 138824892
truedvmdii 141910701
addmulii 168772609
mulss 201178522
usqrt 251600143
rtodbl 295522537
addmulii_lg3 475527022
sqrz_i 562124687
sqrr 595631463
mulsi 617811095
sqru 639668708
mulrrz_3 658720782
mulur_2 722225174
mulrrz_3end 779663966
mulur 944739007
mulir 994262559
mului 1112212568
divru 1117574301
affrr 1378535210
addmulii_inplace 1617831093
sqri 2077834543
shifti 2287282112
vals 2318791604
modii 3124127074
mulrrz_end 3640027700
mulrrz_i 3791897611
mulrr 4038975628
muluu 4649235753
mulii 21151303335

Generated by: LCOV version 1.16