runtests: support memory-limits per test

The idea here is to set limits per test how many allocations and maximum
amount of memory it is allowed to use. This is a means to make sure the
number and total size of allocations are kept in check and don't
mistakenly "blow up".

If runtests.pl detects that the given limits have been exceeded it fails
the test case with an error.

The `<verify>` part now supports `<limits>`, and in this section two
limits can be set for each test (verified in debug builds only):

    Allocations: [number of allocation calls]
    Maximum allocated: [maximum concurrent memory allocated]

Default limits (used if nothing is set in the test file):

    Allocations: 1000
    Maximum allocated: 1000000

Closes #17821
This commit is contained in:
Daniel Stenberg 2025-07-04 23:57:03 +02:00
parent 2db8ae480f
commit f00a2add71
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
22 changed files with 120 additions and 1 deletions

View file

@ -57,5 +57,8 @@ Refuse tunneling protocols through HTTP proxy
<errorcode>
56
</errorcode>
<limits>
Allocations: 1700
</limits>
</verify>
</testcase>