nixpkgs/doc/hooks
Sergei Zimmerman 00b1aef96b
ctestCheckHook: init
Motivation for this hook is simple: there's no single documented
way to do trivial things with ctest:

1. Pass additional flags to ctest invocation.
2. Selectively disable tests in a mechanism similar to python's
   `disabledTests` or rust's composable skips in `checkFlags`.
3. Disable parallel checking.

Current state of things has lead to several different solutions:

1. Completely overriding `checkPhase` [1] and invoking ctest manually
   with the necessary flags. This is most often coupled with `-E` for
   disabling test or setting parallel level.
2. Wrangling with weird double string/regex escaping and trying to stuff
   additional parameters and/or exclusion regex via `CMAKE_CTEST_ARGUMENTS`.
   This approach is especially painful when test names have spaces. This is
   the reason I originally decided to implement this hook after wrangling with
   failing darwin tests here [2].
3. Stuffing additional arguments into `checkFlagsArray` with the
   `ARGS` makefile parameter [3].

I don't see any reason to keep the status-quo. Doing something along these
lines has been suggested [4] for both `ctest` and `meson`. Meson setup-hook
has switched from `ninja` to `meson` in [5] with little friction. Doing
the same for cmake in a single sweep would prove problematic due to the
aforementioned zoo of workarounds and hacks for `ctest`. Doing it via
a separate hook would allow us to refactor things piecemeal and without
going through staging. The benefit of the hook is immediately clear and it
would allow to drive the refactor tractor at a comfortable pace.

[1]: pd/pdal/package.nix:117, cc/ccache/package.nix:108, gl/glog/package.nix:79
[2]: https://www.github.com/NixOS/nixpkgs/pull/375955
[3]: op/open62541/package.nix:114
[4]: https://www.github.com/NixOS/nixpkgs/issues/113829
[5]: https://www.github.com/NixOS/nixpkgs/pull/213845
2025-04-26 16:48:53 +00:00
..
autoconf.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
automake.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
autopatchcil.section.md docs/autoPatchcilHook: init 2025-04-10 10:06:57 -03:00
autopatchelf.section.md doc: avoid 'simply' (#266434) 2023-11-09 21:48:05 +01:00
aws-c-common.section.md doc/hooks/aws-c-common: init 2024-11-10 02:39:27 +00:00
bmake.section.md doc: include short docs about bmake 2023-09-22 01:38:23 -03:00
breakpoint.section.md docs/breakpointHook: simplify instructions 2025-01-05 14:36:05 +01:00
cernlib.section.md doc/hooks/cernlib: document CERNLIB hook (#341691) 2024-09-14 01:26:40 -04:00
cmake.section.md ctestCheckHook: init 2025-04-26 16:48:53 +00:00
desktop-file-utils.section.md doc/hooks/desktop-file-utils: document hook 2024-09-11 18:01:32 -07:00
gdk-pixbuf.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
ghc.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
gnome.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
haredo.section.md doc/hooks/haredo: add documentation 2024-09-14 10:33:41 -07:00
index.md docs/autoPatchcilHook: init 2025-04-10 10:06:57 -03:00
installShellFiles.section.md installShellFiles: add emulator doc for installShellCompletion 2025-03-16 23:57:39 +08:00
just.section.md doc/hooks/just: fix link 2024-10-24 07:01:14 +00:00
libiconv.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
libxml2.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
memcached-test-hook.section.md doc: fix various nix snippets 2025-04-17 01:30:34 +02:00
meson.section.md meson/setup-hook.sh: make build directory configurable 2024-10-21 12:11:35 -04:00
mpi-check-hook.section.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
ninja.section.md meson.setupHook: prefer meson commands over ninja 2023-10-09 10:21:36 +00:00
patch-rc-path-hooks.section.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
perl.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
pkg-config.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
postgresql-test-hook.section.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
premake.section.md doc/hooks/premake: add documentation 2024-09-15 16:20:20 +02:00
python.section.md doc: clarify python.sitePackages 2024-01-31 14:34:19 +01:00
redis-test-hook.section.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
scons.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
tauri.section.md doc: use finalAttrs pattern 2025-04-21 07:02:49 +02:00
tetex-tex-live.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
unzip.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
validatePkgConfig.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
versionCheckHook.section.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
waf.section.md waf: make executable runnable (#388010) 2025-03-27 12:42:10 -04:00
xcbuild.section.md doc: make sure section depths are consecutive 2023-06-10 18:17:04 +02:00
xfce4-dev-tools.section.md doc/hooks/xfce4-dev-tools: document hook 2024-10-31 21:48:26 +00:00
zig.section.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00