# std.Build: extend \`test_runner\` option to specify whether runner uses \`std.zig.Server\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b8e568504e1dca38273a5845ac20d056cd7db5bb)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b8e568504e1dca38273a5845ac20d056cd7db5bb

Requested commit: b8e568504e1dca38273a5845ac20d056cd7db5bb

Commit: b8e568504e1dca38273a5845ac20d056cd7db5bb

Tree: 82822f7b5d9be9aeec46a5cda41ea05a156137bc

Author: mlugg

Committer: mlugg

## Message

```
std.Build: extend `test_runner` option to specify whether runner uses `std.zig.Server`

The previous logic here was trying to assume that custom test runners
never used `std.zig.Server` to communicate with the build runner;
however, it was flawed, because modifying the `test_runner` field on
`Step.Compile` would not update this flag. That might have been
intentional (allowing a way for the user to specify a custom test runner
which *does* use the compiler server protocol), but if so, it was a
flawed API, since it was too easy to update one field without updating
the other.

Instead, bundle these two pieces of state into a new type
`std.Build.Step.Compile.TestRunner`. When passing a custom test runner,
you are now *provided* to specify whether it is a "simple" runner, or
whether it uses the compiler server protocol.

This is a breaking change, but is unlikely to affect many people, since
custom test runners are seldom used in the wild.

```

## Parents

- [b074fb7ddaefaa6ed9c5235d22b2f7378e3b80e8](https://git.cafe/gitcafe/zig/commit/b074fb7ddaefaa6ed9c5235d22b2f7378e3b80e8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b8e568504e1dca38273a5845ac20d056cd7db5bb?format=markdown)
