···3333#### `dontUseCmakeConfigure` {#dont-use-cmake-configure}
34343535When set to true, don't use the predefined `cmakeConfigurePhase`.
3636+3737+## Controlling CTest invocation {#cmake-ctest}
3838+3939+By default tests are run by make in [`checkPhase`](#ssec-check-phase) or by [ninja](#ninja) if `ninja` is
4040+available in `nativeBuildInputs`. Makefile and Ninja generators produce the `test` target, which invokes `ctest` under the hood.
4141+This makes passing additional arguments to `ctest` difficult, so it's possible to invoke it directly in `checkPhase`
4242+by adding `ctestCheckHook` to `nativeCheckInputs`.
4343+4444+### CTest Variables {#cmake-ctest-variables}
4545+4646+#### `disabledTests` {#cmake-ctest-disabled-tests}
4747+4848+Allows to disable running a list of tests. Note that regular expressions are not supported by `disabledTests`, but
4949+it can be combined with `--exclude-regex` option.
5050+5151+#### `ctestFlags` {#cmake-ctest-flags}
5252+5353+Additional options passed to `ctest` together with `checkFlags`.
···4545 # Test dependencies
4646 cxxtest,
4747 ruby,
4848+ ctestCheckHook,
4849}:
49505051assert builtins.any (g: guiModule == g) [
···151152 nativeCheckInputs = [
152153 cxxtest
153154 ruby
155155+ ctestCheckHook
154156 ];
155157156156- # TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
157157- checkPhase =
158158- let
159159- disabledTests =
160160- # PortChecker is non-deterministic. It's fixed in the master
161161- # branch, but backporting would require an update to rtosc, so
162162- # we'll just disable it until the next release.
163163- [ "PortChecker" ]
164164-165165- # Tests fail on aarch64
166166- ++ lib.optionals stdenv.hostPlatform.isAarch64 [
167167- "MessageTest"
168168- "UnisonTest"
169169- ];
170170- in
171171- ''
172172- runHook preCheck
173173- ctest --output-on-failure -E '^${lib.concatStringsSep "|" disabledTests}$'
174174- runHook postCheck
175175- '';
158158+ disabledTests =
159159+ # PortChecker is non-deterministic. It's fixed in the master
160160+ # branch, but backporting would require an update to rtosc, so
161161+ # we'll just disable it until the next release.
162162+ [ "PortChecker" ]
163163+ # Tests fail on aarch64
164164+ ++ lib.optionals stdenv.hostPlatform.isAarch64 [
165165+ "MessageTest"
166166+ "UnisonTest"
167167+ ];
176168177169 # Use Zyn-Fusion logo for zest build
178170 # An SVG version of the logo isn't hosted anywhere we can fetch, I