Run Zig test blocks from Clojure. deftestz defines a Clojure test
that compiles a Zig body with zig test, runs the resulting test
binary, and asserts the exit code is zero (all tests passed).
The Zig body may include test blocks and any declarations the test
blocks reference. The namespace's defz declarations and named types
are prepended automatically. Example body text:
test one_plus_one {
try std.testing.expect(1 + 1 == 2);
}
Run Zig `test` blocks from Clojure. `deftestz` defines a Clojure test
that compiles a Zig body with `zig test`, runs the resulting test
binary, and asserts the exit code is zero (all tests passed).
The Zig body may include `test` blocks and any declarations the test
blocks reference. The namespace's `defz` declarations and named types
are prepended automatically. Example body text:
test one_plus_one {
try std.testing.expect(1 + 1 == 2);
}
(deftestz name body)(deftestz name docstring body)Define a Clojure test that runs Zig test blocks. The body is a
string of Zig source containing test blocks. The test passes when
zig test exits zero; on failure, the toolchain/test-runner output is
included in the assertion message.
Define a Clojure test that runs Zig `test` blocks. The `body` is a string of Zig source containing `test` blocks. The test passes when `zig test` exits zero; on failure, the toolchain/test-runner output is included in the assertion message.
(run-zig-test source)Compile and run source as a Zig test binary. Returns
{:pass true} on exit code 0, or {:pass false :output stderr} on
failure.
Compile and run `source` as a Zig test binary. Returns
`{:pass true}` on exit code 0, or `{:pass false :output stderr}` on
failure.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |