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 30532-0c728fd268) Lines: 535 567 94.4 %
Date: 2025-10-18 09:22:31 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 187457
mul0r 482311
sqrs 732515
divur 2509215
divir 3503533
truedvmdsi 6202031
divrs 9869795
dbltor 13388588
int2u 26154556
dblexpo 26477230
mantissa_real 53606850
mulrrz_int 55697010
invmod2BIL 60744878
trunc2nr 62693387
invr_basecase 63130598
invr 63131703
addmulii_gen 90727532
int2n 105931676
mulsr 118070804
truedvmdis 130857973
truedvmdii 133940547
addmulii 168637129
mulss 201178761
usqrt 231812358
rtodbl 289684501
addmulii_lg3 472715210
sqrz_i 561448685
sqrr 594271887
mulsi 609219961
sqru 627341351
mulrrz_3 654388762
mulur_2 706237126
mulrrz_3end 775085879
mulur 928212211
mulir 986885415
mului 1108696156
divru 1113015120
affrr 1379676928
addmulii_inplace 1581310819
sqri 1912611555
vals 2267134822
shifti 2270019680
modii 3083885842
mulrrz_end 3600745069
mulrrz_i 3751283096
mulrr 3997447243
muluu 4562195519
mulii 20973658737

Generated by: LCOV version 1.16