Skip to content

Commit

Permalink
run security checks + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StringNick committed Jun 26, 2024
1 parent a102838 commit 86098e0
Show file tree
Hide file tree
Showing 10 changed files with 583 additions and 18 deletions.
9 changes: 9 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ pub fn build(b: *std.Build) void {
// Creates a step for unit testing. This only builds the test executable
// but does not run it.
const unit_tests = b.addTest(.{
.name = "unit_tests",
.root_source_file = b.path("src/tests.zig"),
.target = target,
.optimize = optimize,
Expand All @@ -155,6 +156,13 @@ pub fn build(b: *std.Build) void {
mod.module,
);

const build_unit_tests = b.addInstallArtifact(unit_tests, .{});

// Creating run step for building unit tests
const build_test_step = b.step("build-test", "Build test binary");
build_test_step.dependOn(&lib.step);
build_test_step.dependOn(&build_unit_tests.step);

const run_unit_tests = b.addRunArtifact(unit_tests);

// Similar to creating the run step earlier, this exposes a `test` step to
Expand All @@ -164,6 +172,7 @@ pub fn build(b: *std.Build) void {
"test",
"Run unit tests",
);

test_step.dependOn(&lib.step);
test_step.dependOn(&run_unit_tests.step);
}
Expand Down
Loading

0 comments on commit 86098e0

Please sign in to comment.