This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
pubconstTestResults = struct {
/// The total number of tests in the step. Every test has a "status" from the following:/// * passed/// * skipped/// * failed cleanly/// * crashed/// * timed outtest_count: u32 = 0,
/// The number of tests which were skipped (`error.SkipZigTest`).skip_count: u32 = 0,
/// The number of tests which failed cleanly.fail_count: u32 = 0,
/// The number of tests which terminated unexpectedly, i.e. crashed.crash_count: u32 = 0,
/// The number of tests which timed out.timeout_count: u32 = 0,
/// The number of detected memory leaks. The associated test may still have passed; indeed, *all*/// individual tests may have passed. However, the step as a whole fails if any test has leaks.leak_count: u32 = 0,
/// The number of detected error logs. The associated test may still have passed; indeed, *all*/// individual tests may have passed. However, the step as a whole fails if any test logs errors.log_err_count: u32 = 0,
pubfnisSuccess(tr: TestResults) bool {
// all steps are success or skipreturntr.fail_count == 0andtr.crash_count == 0andtr.timeout_count == 0and// no (otherwise successful) step leaked memory or logged errorstr.leak_count == 0andtr.log_err_count == 0;
}
/// Computes the number of tests which passed from the other values.pubfnpassCount(tr: TestResults) u32 {
returntr.test_count - tr.skip_count - tr.fail_count - tr.crash_count - tr.timeout_count;
}
}