0Pricing
Zig Academy · Lesson

Running and Filtering Tests

Use zig test and narrow the run.

One Command to Test

To run the tests in a file you call the compiler in test mode. The zig test command compiles and executes every test block it finds.

zig test src/main.zig

Point It at a File

You give zig test the root source file. It pulls in tests from that file and from any file reached through @import.

All lessons in this course

  1. Writing test Blocks
  2. Assertions with std.testing
  3. The Testing Allocator Catches Leaks
  4. Running and Filtering Tests
← Back to Zig Academy