Test suite - adam-r-kowalski/compute_graph GitHub Wiki

Running the full test suite

zig test src/main.zig

Running all unit tests in a single source file

zig test --main-pkg-path . src/eager/add.zig

Filtering tests by name

zig test src/eager/add.zig --main-pkg-path . --test-filter "add backwards broadcast rank 3 to rank 4"

Profiling the compiler

zig test src/main.zig -ftime-report

Debugging a single unit test

  1. Build a binary by specifying the corresponding source file to the zig compiler as well as specifying the name of the test to filter on.
zig test src/eager/add.zig --cache off --verbose-link --main-pkg-path . --test-filter "add backwards broadcast rank 3 to rank 4"
  1. Launch the debugger (gdb/lldb) pointing at the newly produced "test" binary.
lldb ./test