mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:03:33 +03:00
tests: drop mk-bundle exceptions
Using a mixture of techniques to avoid symbols collisions: - reduce scope. - add `t*_` / `T*_` prefix. - move shared functions to `testutil.c`. (`suburl()`, `rlim2str()`) - clone re-used lib*.c sources. (lib587, lib645) - include shared symbols just once in re-used `lib*.c` sources. (using `LIB*_C` guards.) - drop re-used `lib*.c` sources where they were identical or unused. - make macros global. - #undef macros before use. What remain is the entry functions `test`, and `unit_setup`, `unit_stop` in unit tests. Also: - fix formatting and other minor things along the way. - add `const` where possible. - sync some symbol names between tests. - drop `mk-bundle-hints.sh` that's no longer necessary. Closes #17468
This commit is contained in:
parent
9ed34cc45b
commit
6897aeb105
142 changed files with 2055 additions and 1893 deletions
|
|
@ -39,7 +39,7 @@ int main(int argc, char **argv)
|
|||
main_func = NULL;
|
||||
{
|
||||
size_t tmp;
|
||||
for(tmp = 0; s_mains[tmp].ptr; ++tmp) {
|
||||
for(tmp = 0; tmp < CURL_ARRAYSIZE(s_mains); ++tmp) {
|
||||
if(strcmp(main_name, s_mains[tmp].name) == 0) {
|
||||
main_func = s_mains[tmp].ptr;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
# Bundle up individual tests into a single binary. The resulting binary can run
|
||||
# individual tests by passing their name (without '.c') as the first argument.
|
||||
#
|
||||
# Usage: mk-bundle.pl [<server_c>]
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
|
@ -82,8 +80,7 @@ foreach my $src (@src) {
|
|||
|
||||
print <<FOOTER
|
||||
static const struct onemain s_mains[] = {
|
||||
${tlist} {NULL, NULL}
|
||||
};
|
||||
$tlist};
|
||||
|
||||
#include "first.c"
|
||||
FOOTER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue