~reesmichael1/gridz

7e0ad720775c901af48d14ba113f1aee37a81692 — Michael Rees 5 months ago ff8b6ab master
Add test runner step (via zig build test)
1 files changed, 16 insertions(+), 1 deletions(-)

M build.zig
M build.zig => build.zig +16 -1
@@ 19,6 19,21 @@ pub fn build(b: *Builder) void {
    const run_cmd = exe.run();
    run_cmd.step.dependOn(b.getInstallStep());

    const run_step = b.step("run", "Run the app");
    const run_step = b.step("run", "Start a new game");
    run_step.dependOn(&run_cmd.step);

    const test_step = b.step("test", "Run the program tests");

    // Add any files that contain tests to this list
    const testable_files = [_][]const u8{
        "src/city.zig",
        "src/grid.zig",
        "src/player.zig",
        "src/resource_market.zig",
    };

    for (testable_files) |file| {
        const file_tests = b.addTest(file);
        test_step.dependOn(&file_tests.step);
    }
}