diff --git a/build.zig b/build.zig index 4ab82c9762a9a5726b155bd0bf3f32c9a409007f..a6d84b25dec5008530db36494120004b2916ff6e 100644 --- a/build.zig +++ b/build.zig @@ -19,4 +19,16 @@ pub fn build(b: *std.Build) void { .install_dir = .header, .install_subdir = "unicode", }); + + const tests = b.addTest(.{ + .root_source_file = b.path("test.zig"), + .target = target, + .optimize = mode, + }); + deps.addAllTo(tests); + + const test_step = b.step("test", "Run all library tests"); + const tests_run = b.addRunArtifact(tests); + tests_run.has_side_effects = true; + test_step.dependOn(&tests_run.step); } diff --git a/test.zig b/test.zig new file mode 100644 index 0000000000000000000000000000000000000000..7cdb2eea6731a5f0e580a6b8bdbe29509fdf3637 --- /dev/null +++ b/test.zig @@ -0,0 +1,7 @@ +const std = @import("std"); +const icu = @import("icu"); + +// TODO: run the official test suite from unicode +test { + std.testing.refAllDeclsRecursive(icu); +}