mirror of
https://github.com/curl/curl.git
synced 2026-04-12 12:21:42 +08:00
74a169575d
8 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9630593650
|
build: use more const
Mostly with `char *` types. Also: - mime, x509asn1, tool_operate, lib3207: drop redundant casts. - examples/smooth-gtk-thread: add missing variable declaration. - reduce variable scopes. - tests/server: move `data_to_hex()` to its only user: `sws`. Closes #20489 |
||
|
|
7d9004ee47
|
build: drop duplicate C includes
- `stdlib.h` and `string.h` is included via `curl_setup_once.h`, allowing to drop from `tests/server` sources and `tool_doswin.c`. - `stdlib.h` is also included via `setup-vms.h` (earlier than above), allowing to drop it from `curl_addrinfo.h` on VMS. Closes #20303 |
||
|
|
b10b7c1fce
|
tests/server: fix initialization on Windows Vista+
Make sure to call `curlx_now_init()` before the first call to `curlx_now()`. Before this patch the first `curlx_now()` used the non-Vista code path calling `GetTickCount()` on Vista+. This is harmless, but the upcoming PR #18009 is going to drop the non-Vista code path, causing a division by zero at startup in test servers, without this fix. Bug: https://github.com/curl/curl/pull/18009#issuecomment-3652154307 Closes #19973 |
||
|
|
6a0cd4feb7
|
tests: make individual test sources compile cleanly
Tidy up headers and includes to ensure all individual test source compile cleanly (but not link). To allow running clang-tidy (and possibly other static analyzers) on them. It also improves readability and allows to verify them locally, without the bundle logic. clang-tidy ignores #included C files, so it's blind to bundle C files the include these tests. The current workaround of embedding has a couple of downsides:. meaningless filenames and line numbers, missing issues, messing up self header paths. Thus, running it on individual sources would be beneficial. Also: - de-duplicate includes. - untangle some includes. - formatting/indentation fixes. - merge `getpart.h` into `first.h`. Ref: https://github.com/curl/curl/pull/17680#issuecomment-2991730158 Closes #17703 |
||
|
|
639d5e0f5e
|
tests: tidy up server main function, whitespace and README
Follow-up to
|
||
|
|
2c27a67daa
|
tests: always make bundles, adapt build and tests
Make test bundles the default. Drop non-bundle build mode.
Also do all the optimizations and tidy-ups this allows, simpler builds,
less bundle exceptions, streamlined build mechanics.
Also rework the init/deinit macro magic for unit tests. The new method
allows using unique init/deinit function names, and calling them with
arguments. This is in turn makes it possible to reduce the use of global
variables.
Note this drop existing build options `-DCURL_TEST_BUNDLES=` from cmake
and `--enable-test-bundles` / `--disable-test-bundles` from autotools.
Also:
- rename test entry functions to have unique names: `test_<testname>`
This removes the last exception that was handled in the generator.
- fix `make dist` to not miss test sources with test bundles enabled.
- sync and merge `tests/mk-bundle.pl` into `scripts/mk-unity.pl`.
- mk-unity.pl: add `--embed` option and use it when `CURL_CLANG_TIDY=ON`
to ensure that `clang-tidy` does not miss external test C sources.
(because `clang-tidy` ignores code that's #included.)
- tests/unit: drop no-op setup/stop functions.
- tests: reduce symbol scopes, global macros, other fixes and tidy-ups.
- tool1621: fix to run, also fix it to pass.
- sockfilt: fix Windows compiler warning in certain unity include order,
by explicitly including `warnless.h`.
Follow-up to
|
||
|
|
6897aeb105
|
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 |
||
|
|
f4f25505df
|
tests/server: support bundle binary
Extend existing `--enable-test-bundles` and `-DCURL_TEST_BUNDLES=ON` options to also bundle test server programs into a single binary. With autotools, also bundle auxiliary libcurl sources for a "unity"-style build. It saves almost 10 minutes per run, across all CI jobs. On average it makes `build tests` steps 25% faster. With CMake, it brings down `testdeps` build steps to 32 to 37, from 45 to 64 before this patch, with unity. Without unity it brings it down from 400-420 to 280-300. For comparison, without unity and bundles, the number of build steps is around 1850. With autotools the gain is possibly larger because this patch does unity and bundle for test servers. The total reduction of build steps / log lines is 12000. It's 44% of reduction on average across all CI jobs. Follow-up to |