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 30773-2078653b96) Lines: 535 567 94.4 %
Date: 2026-04-02 09:26:53 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 186614
mul0r 482281
sqrs 732801
divur 2524357
divir 3517221
truedvmdsi 6202031
divrs 9999077
dbltor 13463252
int2u 25349868
dblexpo 27264874
mulrrz_int 53799215
mantissa_real 54199904
invmod2BIL 60819575
trunc2nr 62833565
invr_basecase 65142431
invr 65142856
addmulii_gen 90690437
int2n 108508431
mulsr 120368289
truedvmdis 138827230
truedvmdii 141909356
addmulii 168729657
mulss 201177968
usqrt 251439556
rtodbl 295542127
addmulii_lg3 475492580
sqrz_i 561722264
sqrr 595345086
mulsi 617830416
sqru 640025896
mulrrz_3 658254930
mulur_2 722594062
mulrrz_3end 778954941
mulur 945028041
mulir 994636657
mului 1113554593
divru 1117350748
affrr 1378385499
addmulii_inplace 1617814995
sqri 2076902975
shifti 2285978088
vals 2315955806
modii 3123082907
mulrrz_end 3638551706
mulrrz_i 3789521750
mulrr 4039218392
muluu 4648006962
mulii 21146823294

Generated by: LCOV version 1.16