curl/tests/server
Viktor Szakats fabfa8e402
clang-tidy: add to CI, add cmake support, fix fallouts
build:
- autotools: fix to build generated sources for the `tidy` target.
- autotools: allow passing custom clang-tidy options via
  `CURL_CLANG_TIDYFLAGS` env.
- cmake: add `CURL_CLANG_TIDY` option to configure for `clang-tidy`.
  Also add:
  - `CLANG_TIDY` variable to customize the `clang-tidy` tool.
  - `CURL_CLANG_TIDYFLAGS` to pass custom options to `clang-tidy`.
- apply `--enable-werror` and `-DCURL_WERROR=ON` to `clang-tidy`.

CI/GHA:
- add clang-tidy job for Linux, using autotools and clang-tidy v18.
  This one needs to disable `clang-analyzer-valist.Uninitialized`
  to avoid false positives:
  https://github.com/llvm/llvm-project/issues/40656
  Duration: 5.5 minutes
- add clang-tidy job for macOS, using cmake and clang-tidy v19.
  This one also covers tests and examples, and doesn't hit the false
  positives seen with llvm v18 and earlier.
  Duration: 4.5 minutes
- Linux/macOS: skip installing test dependencies when not building or
  running tests.

fix fallouts reported by `clang-tidy`:
- lib:
  - cf-h2-proxy: unused assignment in non-debug builds.
  - cf-socket: silence warning.
    FIXME: https://github.com/curl/curl/pull/15825#issuecomment-2561867769
  - ftp: NULL passed to `strncmp()`.
  - http2: NULL-ptr deref.
  - mprintf: silence warning.
- src/tool_writeout: NULL passed to `fputs()`.
- examples:
  - invalid file pointers.
  - missing `fclose()`.
- tests:
  - http/clients/hx-download: memory leaks on error.
  - http/clients/hx-download: memory leak on repeat `-r` option.
  - server: double `fclose()`.
    https://www.man7.org/linux/man-pages/man3/fclose.3.html
  - server: invalid file pointer/handle.
  - server/getpart: unused assignments.
  - server/mqttd: leak on failed `realloc()`.
  - server/tftpd: NULL passed to `strcmp()`.

Closes #15825
2024-12-27 13:42:32 +01:00
..
.checksrc checksrc: ban use of sscanf() 2024-12-13 09:43:05 +01:00
.gitignore NTLM_WB: delete remains in tests, docs updates 2024-09-10 14:13:36 +02:00
base64.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeLists.txt binmode: convert to macro and use it from tests 2024-12-21 13:29:24 +01:00
disabled.c strparse: string parsing helper functions 2024-12-12 16:00:52 +01:00
getpart.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
getpart.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am binmode: convert to macro and use it from tests 2024-12-21 13:29:24 +01:00
Makefile.inc NTLM_WB: delete remains in tests, docs updates 2024-09-10 14:13:36 +02:00
mqttd.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
resolve.c Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
rtspd.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
server_setup.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
server_sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
sockfilt.c binmode: convert to macro and use it from tests 2024-12-21 13:29:24 +01:00
socksd.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
sws.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
testpart.c lib/src: white space edits to comply better with code style 2024-09-19 14:59:12 +02:00
tftp.h tests: tidy up types in server code 2024-05-13 11:16:26 +02:00
tftpd.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
util.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
util.h build: enable missing OpenSSF-recommended warnings, with fixes 2023-12-16 13:12:37 +00:00