]> git.ipfire.org Git - thirdparty/curl.git/commit
build: untangle `UNITTESTS` and `DEBUGBUILD` macros
authorViktor Szakats <commit@vsz.me>
Thu, 16 May 2024 11:49:22 +0000 (13:49 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 27 May 2024 19:15:50 +0000 (21:15 +0200)
commitfc8e0dee3045658f293452121f5290d81ba3aa1e
tree033021fc3621ecd712ef75b360f74ade956fd957
parent837378309860839496d2c7429d5befa7faac538c
build: untangle `UNITTESTS` and `DEBUGBUILD` macros

- fix `DEBUGBUILD` guards that should be `UNITTESTS`, in libcurl code
  used by unit tests.
- fix guards for libcurl functions used in unit tests only.
- sync `UNITTEST` attribute between declarations and definitions.
- drop `DEBUGBUILD` guard from test `unit2600`.
- fix guards for libcurl HSTS code used by both a unit test (`unit1660`)
  and `test0446`.
- update an existing AppVeyor CI job to test the issues fixed.

This fixes building tests with `CURLDEBUG` enabled but `DEBUGBUILD`
disabled. This can happen when building tests with CMake with
`ENABLE_DEBUG=ON` in Release config, or with `ENABLE_CURLDEBUG=ON`
and _without_ `ENABLE_DEBUG=ON`. Possibly also with autotools
when using `--enable-curldebug` without `--enable-debug`.

Test results:
- before:
  https://ci.appveyor.com/project/curlorg/curl/builds/49835609
  https://ci.appveyor.com/project/curlorg/curl/builds/49898529/job/k8qpbs8idby70smw
  https://github.com/curl/curl/actions/runs/9259078835/job/25470318167?pr=13798#step:13:821
- after: https://ci.appveyor.com/project/curlorg/curl/builds/49839255
  (the two failures are unrelated, subject to PR #13705)

Ref: #13592 (issue discovery)
Ref: #13689 (CI testing this PR with `DEBUGBUILD`/`CURLDEBUG` combinations)
Closes #13694
15 files changed:
appveyor.sh
appveyor.yml
lib/cfilters.c
lib/cfilters.h
lib/connect.c
lib/connect.h
lib/curl_setup.h
lib/doh.h
lib/dynhds.c
lib/dynhds.h
lib/hsts.c
lib/hsts.h
lib/noproxy.h
lib/urlapi-int.h
tests/unit/unit2600.c