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 Coverage Total Hit
Test: PARI/GP v2.18.1 lcov report (development 31042-0fbe168e69) Lines: 90.4 % 177021 160001
Test Date: 2026-07-23 17:04:59 Functions: 92.4 % 16338 15095
Legend: Rating: low: < 75 % medium: >= 75 % high: >= 90 %

Directory Sort by file name Line Coverage Sort by line coverage Function Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
gp/
50.1%50.1%
50.1 % 696 349 45.9 % 61 28
graph/
78.1%78.1%
78.1 % 1701 1328 76.9 % 160 123
language/
79.4%79.4%
79.4 % 15489 12297 84.2 % 1428 1202
mt/
94.2%94.2%
94.2 % 359 338 86.2 % 58 50
headers/
92.7%92.7%
92.7 % 1542 1429 92.1 % 712 656
basemath/
91.3%91.3%
91.3 % 140220 128001 93.3 % 12606 11762
kernel/none/
95.3%95.3%
95.3 % 3697 3524 93.4 % 440 411
kernel/gmp/
95.6%95.6%
95.6 % 824 788 96.7 % 60 58
modules/
95.6%95.6%
95.6 % 12493 11947 99.0 % 813 805

Generated by: LCOV version 2.0-1