diff options
Diffstat (limited to 'test/lib/build.zig')
| -rw-r--r-- | test/lib/build.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lib/build.zig b/test/lib/build.zig new file mode 100644 index 00000000..6cd8d6e5 --- /dev/null +++ b/test/lib/build.zig @@ -0,0 +1,18 @@ +//! A package that depends on pardes for its library, as a program that draws +//! source text itself would: pardes's `lib-test` step runs `zig build test` +//! here, so the `pardes-syntax` module is built the way such a package +//! builds it (build.zig's `library`), with the minimal grammars. +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + const pardes = b.dependency("pardes", .{ .target = target, .optimize = optimize, .@"tree-sitter" = .minimal }); + const tests = b.addTest(.{ .root_module = b.createModule(.{ + .target = target, + .optimize = optimize, + .root_source_file = b.path("lib.zig"), + .imports = &.{.{ .name = "pardes-syntax", .module = pardes.module("pardes-syntax") }}, + }) }); + b.step("test", "colour, outline and walk a C and a Zig source through pardes's library").dependOn(&b.addRunArtifact(tests).step); +} |
