# zig test: forward target CLI args to zig run when using \-ofmt=c · gitcafe/zig

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

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

Visibility: public

Requested revision: 9b54c9dee8a571f1c821b3eb4ee3d2c713cf63fa

Requested commit: 9b54c9dee8a571f1c821b3eb4ee3d2c713cf63fa

Commit: 9b54c9dee8a571f1c821b3eb4ee3d2c713cf63fa

Tree: f24ec417b12c1a964eee9a15adbc5454adcd7332

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
zig test: forward target CLI args to zig run when using -ofmt=c

Previously, if you used `zig test -ofmt=c -target foobar` then Zig would
try to compile the generated C code with the native target instead of
"foobar".

With this change, `--test-cmd` with e.g. QEMU still won't work, but at
least the binary will get compiled for the correct target.

```

## Parents

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

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