Change #237990
Category | None |
Changed by | Daniel Stenberg <daniel | @haxx.se>
Changed at | Sun 29 Jun 2025 14:33:13 |
Repository | https://api.github.com/repos/curl/curl |
Project | curl/curl |
Branch | bagder/unit-private-proto |
Revision | 54f4d55729fc4cf51dc9c33f3d3cdb4dc84cd0a3 |
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
Changed files
- lib/.gitignore
- lib/CMakeLists.txt
- lib/Makefile.am
- scripts/Makefile.am
- scripts/extract-unit-protos
- tests/unit/CMakeLists.txt
- tests/unit/Makefile.am
- tests/unit/unit1300.c
- tests/unit/unit1395.c
- tests/unit/unit3212.c
- tests/unit/unit3213.c