Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Change #238017

Category None
Changed by Daniel Stenberg <danielohnoyoudont@haxx.se>
Changed at Sun 29 Jun 2025 17:11:24
Repository https://api.github.com/repos/curl/curl
Project curl/curl
Branch bagder/unit-private-proto
Revision 896e88ab81b87ed4245444e3b4aa80f626092112

Comments

unit tests: extract "private" prototypes at build time

In order to do unit tests for private functions, functions that are
marked UNITTEST but without a global scope in the library, functions
that do not have prototypes in their corresponding header file, unit
tests previously brought their own private prototype *copy* into the
unit test.

This was error-prone when the internal function changes but the change
might be missed in the unit test which then uses an outdated prototype
copy for testing.

This change removes the private prototypes from unit tests and instead
introduces a C file parser that parses the specific C files and extracts
the necessary unit test prototypes into a generated header file for unit
tests to use. This geneated lib/unitprotos.h header is then included by
unit tests that need private prototypes.

Assisted-by: Viktor Szakats
Closes #17750

Changed files