CMake: Add runtests.pl targets, do not build test programs unless necessary #5368
Executive overview, see invididual commits for details:
The next step is to run these tests for the CMake builds in CI, but that would introduce a conflict with my cmake-http3 branch that also modifies the travis config, so I'll wait for that to get merged first.
ninja test-nonflaky summary
The failing tests seem to be existing CMake issues that can be fixed later:
test 1014...[Compare curl --version with curl-config --features]
test 1026...[curl --manual ]
test 1139...[Verify that all libcurl options have man pages]
* runtests.pl: - Fix out-of-tree build under CMake when srcdir is not set. Default srcdir to the location of runtests.pl. - Add a hack to allow CMake to use the TFLAGS option as documented in tests/README and used in scripts/travis/script.sh. * Bump CMake version to 3.2 for USES_TERMINAL, dropping Debian Jessie support (no one should care, it is already EOL.). * Remove CTest since it defines its own 'test' target with no tests since all unittests are already broken and not built by default. * Add new test targets based on the options from Makefile.am. Since new test targets are rarely added, I opted for duplicating the runtests.pl options as opposed to creating a new Makefile.inc file. Use top-level target names (test-x) instead of x-test since that is used by CI and others.