···33#### `dontUseCmakeConfigure` {#dont-use-cmake-configure}
3435When set to true, don't use the predefined `cmakeConfigurePhase`.
000000000000000000
···33#### `dontUseCmakeConfigure` {#dont-use-cmake-configure}
3435When set to true, don't use the predefined `cmakeConfigurePhase`.
36+37+## Controlling CTest invocation {#cmake-ctest}
38+39+By default tests are run by make in [`checkPhase`](#ssec-check-phase) or by [ninja](#ninja) if `ninja` is
40+available in `nativeBuildInputs`. Makefile and Ninja generators produce the `test` target, which invokes `ctest` under the hood.
41+This makes passing additional arguments to `ctest` difficult, so it's possible to invoke it directly in `checkPhase`
42+by adding `ctestCheckHook` to `nativeCheckInputs`.
43+44+### CTest Variables {#cmake-ctest-variables}
45+46+#### `disabledTests` {#cmake-ctest-disabled-tests}
47+48+Allows to disable running a list of tests. Note that regular expressions are not supported by `disabledTests`, but
49+it can be combined with `--exclude-regex` option.
50+51+#### `ctestFlags` {#cmake-ctest-flags}
52+53+Additional options passed to `ctest` together with `checkFlags`.
···45 # Test dependencies
46 cxxtest,
47 ruby,
048}:
4950assert builtins.any (g: guiModule == g) [
···151 nativeCheckInputs = [
152 cxxtest
153 ruby
0154 ];
155156- # TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
157- checkPhase =
158- let
159- disabledTests =
160- # PortChecker is non-deterministic. It's fixed in the master
161- # branch, but backporting would require an update to rtosc, so
162- # we'll just disable it until the next release.
163- [ "PortChecker" ]
164-165- # Tests fail on aarch64
166- ++ lib.optionals stdenv.hostPlatform.isAarch64 [
167- "MessageTest"
168- "UnisonTest"
169- ];
170- in
171- ''
172- runHook preCheck
173- ctest --output-on-failure -E '^${lib.concatStringsSep "|" disabledTests}$'
174- runHook postCheck
175- '';
176177 # Use Zyn-Fusion logo for zest build
178 # An SVG version of the logo isn't hosted anywhere we can fetch, I
···45 # Test dependencies
46 cxxtest,
47 ruby,
48+ ctestCheckHook,
49}:
5051assert builtins.any (g: guiModule == g) [
···152 nativeCheckInputs = [
153 cxxtest
154 ruby
155+ ctestCheckHook
156 ];
157158+ disabledTests =
159+ # PortChecker is non-deterministic. It's fixed in the master
160+ # branch, but backporting would require an update to rtosc, so
161+ # we'll just disable it until the next release.
162+ [ "PortChecker" ]
163+ # Tests fail on aarch64
164+ ++ lib.optionals stdenv.hostPlatform.isAarch64 [
165+ "MessageTest"
166+ "UnisonTest"
167+ ];
0000000000168169 # Use Zyn-Fusion logo for zest build
170 # An SVG version of the logo isn't hosted anywhere we can fetch, I