build: add mode paramater to testStep functions

This commit is contained in:
alichraghi 2022-07-20 16:31:57 +04:30 committed by Stephen Gutekanst
parent 77aecbe806
commit e6adc3e350
8 changed files with 43 additions and 19 deletions

View file

@ -1,12 +1,15 @@
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions();
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&testStep(b).step);
test_step.dependOn(&testStep(b, mode).step);
}
pub fn testStep(b: *std.build.Builder) *std.build.LibExeObjStep {
return b.addTest(thisDir() ++ "/src/main.zig");
pub fn testStep(b: *std.build.Builder, mode: std.builtin.Mode) *std.build.LibExeObjStep {
const main_tests = b.addTest(thisDir() ++ "/src/main.zig");
main_tests.setBuildMode(mode);
return main_tests;
}
pub const pkg = std.build.Pkg{