mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
aaac759d9a
Even though we are using CMake's ctest for testing, we still define our own `make test` target rather than use its default for many reasons: * CMake doesn't run tests in-proc or even add each tests as an individual node in the ninja dependency tree, instead it just bundles all tests into a target called `test` that always just shells out to `ctest`, so there are no build-related benefits to not doing that ourselves. * CMake devs insist that it is appropriate for `make test` to never depend on `make all`, i.e. running `make test` does not require any of the binaries to be built before testing. * The only way to have a test depend on a binary is to add a fake test with a name like "build_fish" that executes CMake recursively to build the `fish` target. * It is not possible to set top-level CTest options/settings such as CTEST_PARALLEL_LEVEL from within the CMake configuration file. * Circling back to the point about individual tests not being actual Makefile targets, CMake does not offer any way to execute a named test via the `make`/`ninja`/whatever interface; the only way to manually invoke test `foo` is to to manually run `ctest` and specify a regex matching `foo` as an argument, e.g. `ctest -R ^foo$`... which is really crazy. With this patch, it is now possible to execute any single test by name, by invoking the build directly, e.g. to run the `universal.fish` check: `cmake --build build --target universal.fish` or `ninja -C build universal.fish`. Unfortunately, this is not integrated into the Makefile wrapper, so `make universal.fish` won't work (although this can potentially be hacked around). |
||
---|---|---|
.. | ||
checks | ||
Benchmark.cmake | ||
CheckIncludeFiles.cmake | ||
ConfigureChecks.cmake | ||
Docs.cmake | ||
gettext.cmake | ||
Install.cmake | ||
Mac.cmake | ||
MacApp.cmake | ||
PCRE2.cmake | ||
Tests.cmake | ||
Version.cmake |