Files
cmake/Tests/RunCMake/CTestCommandLine/Passthrough-build-and-test-error-stderr.txt
Mickaël Germain b3980bf703 ctest: Add support for forwarding arguments to tests via --
Add support for `ctest [options] -- <args>` to forward extra arguments
to every executed test's command line. Arguments after `--` are appended
after each test's own arguments in the order given.

This enables passing options to test frameworks like Google Test or
doctest without needing per-test ARGS properties:

    ctest -R my_test -- --gtest_filter=SomeTest.Case
    ctest --verbose -- --success

An error is raised if `--` is combined with `--build-and-test`, `-S`,
or `-D`/`-T`/`-M` modes, which have their own argument forwarding.
A bare `--` with no following arguments is silently ignored.

Fixes: #20470
2026-03-13 16:21:02 -07:00

2 lines
129 B
Plaintext

^CMake Error: The -- option cannot be used with --build-and-test\. Use --build-options or --test-command to forward arguments\.$