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 30482-15ec328664) Lines: 535 567 94.4 %
Date: 2025-09-06 09:24:15 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 187455
mul0r 482297
sqrs 732024
divur 2506956
divir 3501371
truedvmdsi 6202031
divrs 9865311
dbltor 13386694
int2u 26153818
dblexpo 26467829
mantissa_real 53602645
mulrrz_int 55660756
invmod2BIL 60744266
trunc2nr 62693347
invr_basecase 63106328
invr 63106614
addmulii_gen 90733833
int2n 105911046
mulsr 118139226
truedvmdis 130860308
truedvmdii 133941932
addmulii 168632560
mulss 201178216
usqrt 231333167
rtodbl 289690367
addmulii_lg3 472678363
sqrz_i 561108817
sqrr 594046851
mulsi 609234937
sqru 627141471
mulrrz_3 654015508
mulur_2 706596133
mulrrz_3end 774477000
mulur 928600379
mulir 987563496
mului 1105900306
divru 1113017776
affrr 1379075744
addmulii_inplace 1581197093
sqri 1911857482
vals 2266099487
shifti 2269510345
modii 3081200233
mulrrz_end 3599993254
mulrrz_i 3747956885
mulrr 3996327041
muluu 4562912643
mulii 20972558794

Generated by: LCOV version 1.16