Skip to content

Instantly share code, notes, and snippets.

View davidrios's full-sized avatar

David Rios davidrios

  • São Paulo, Brazil
View GitHub Profile
@karlseguin
karlseguin / test_runner.zig
Last active July 15, 2025 14:18
Custom Zig Test Runner, better ouput, timing display, and support for special "tests:beforeAll" and "tests:afterAll" tests
// This is for the stable version of Zig (0.14.1)
// See https://gist.github.com/karlseguin/e8e74cf5260435ec7cbf3e4c71605722
// for a version that tracks Zig's development branch.
// in your build.zig, you can specify a custom test runner:
// const tests = b.addTest(.{
// .target = target,
// .optimize = optimize,
// .test_runner = .{ .path = b.path("test_runner.zig"), .mode = .simple }, // add this line
// .root_source_file = b.path("src/main.zig"),