Skip to content

Commit 27f5f22

Browse files
committed
tests
1 parent 19d36c7 commit 27f5f22

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ jobs:
3232
- name: Check format
3333
continue-on-error: true
3434
run: zig fmt --check .
35-
- name: Build
36-
run: zig build
35+
- name: Build and run tests
36+
run: zig build test

build.zig

+14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ pub fn build(b: *std.Build) void {
1111
.root_source_file = b.path("src/zopengl.zig"),
1212
});
1313

14+
{
15+
const test_step = b.step("test", "Run zopengl tests");
16+
17+
const tests = b.addTest(.{
18+
.name = "zopengl-tests",
19+
.root_source_file = b.path("src/zopengl.zig"),
20+
.target = target,
21+
.optimize = optimize,
22+
});
23+
b.installArtifact(tests);
24+
25+
test_step.dependOn(&b.addRunArtifact(tests).step);
26+
}
27+
1428
const lib = b.addStaticLibrary(.{
1529
.name = "zopengl",
1630
.root_source_file = b.path("src/zopengl.zig"),

0 commit comments

Comments
 (0)