-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
tests: build non-debug unit tests with autotools, run them #16771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This costs build time. It's +50 programs (in bundle mode it's just +1). Another take on this is to disable building unittests in cmake non-debug-enabled builds. There is no technical reason not to build them, but if running tests in this combination doesn't make any sense, it'd be best to skip building it also in cmake to save time. Example with Cygwin, bundles enabled:
edit: from a test coverage POV building these is pointless, because runtests skips unittest if the build is not debug-enabled. From a build coverage POV, dropping unittests reduces it by disabling unittests in non-debug-enabled cmake jobs, like macos clang-tidy, mingw UWP, mingw32ce, MS-DOS, AmigaOS, and more. Building everything in debug mode would fix it, but that reduces coverage for non-debug builds. Perhaps an extra option to enable building it anyway would solve this. Or, just leaving it as-is and accept that cmake is different here than autotools. The cost of building is much less with cmake, esp when using unity and/or bundles. |
…led (like cmake)" This reverts commit b4b62f6.
Also enable for clang-tidy job explicitly for coverage. Lost unittest build coverage: mingw UWP, mingw32ce This saves time for non-debug-enabled builds by not building what's skipped by test runs anyway. At the same time it reduces bulid coverage in CI. (Possibly not saving much for most jobs due to unity and bundles, though it's both libcurlu and unit test binaries.) Also note: - http/client programs are also built unconditionally (in autotools too), even when pytests aren't configured and run.
This reverts commit 36aaa7a.
…bled (like cmake)" This reverts commit dc49284.
36aaa7a
to
3be165f
Compare
Though it passes regardless, so CURL_TIME maybe isn't required, or passes by chance anyway?
Hm, it looks like unittests do not actually require a debug-enabled build, at least according to a CI run with this runtests condition removed. Except test 1654 that missed the Debug feature label, and another one that also uses I'd go with unlocking this combination in Before:
https://github.com/curl/curl/actions/runs/13967157858/job/39100108697#step:15:3552 After:
https://github.com/curl/curl/actions/runs/13969017959/job/39106067593?pr=16771 |
It means test 1660 require the Debug feature flag and a debug-enabled build to run. To make this consistent with altsvc.c.
This reverts commit d832616.
This reverts commit 7d279a5. Not required, hsts.c includes CURL_TIME support for unitests libcurlu.
To make it consistent with hsts.c.
This reverts commit da6ce33. Overridden by the altsvs.c fix.
Before this patch, autotools disabled building unit tests for
non-debug-enabled (
DEBUGBUILD
) builds. runtests skipped running thiscombination, though they were built in cmake builds. There seems to be
no technical reason anymore for these restrictions. This patch removes
them, allowing to build and run unit tests for non-debug-enabled builds.
To improve unit test build and run coverage.
autotools: do not disable building unit tests for non-debug-enabled
build. Bringing behavior closer to cmake builds. (There are still
exceptions in autotools, something for another PR)
runtests: run unit tests for non-debug-enabled builds.
It extends coverage by 50 tests.
lib/altsvc.c
: fix to includeCURL_TIME
support in libcurlu, forunit tests. It fixes test 1654, and syncs
CURL_TIME
behavior withtest 1660 and
lib/hsts.c
.Ref: 10a7d05
Ref: fc8e0de #13694
Ref: 99f78cb #16770