diff --git a/build.zig b/build.zig index ae27a4e73fbcf849d808b26bd5cca8ea042b5ba7..3d2fa7b3deb8d6266ff28cbf9ebdba706fbbc831 100644 --- a/build.zig +++ b/build.zig @@ -13,6 +13,18 @@ pub fn build(b: *std.Build) void { if (std.mem.eql(u8, step, "generate")) { addExeStep(b, target, mode, "generate", "generate.zig", "Generate the bindings"); } + + 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); } fn addExeStep(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, name: []const u8, root_src: []const u8, sdescription: []const u8) void { diff --git a/test.zig b/test.zig new file mode 100644 index 0000000000000000000000000000000000000000..d732811ce69e6263edf2aefff4dc6947d8599817 --- /dev/null +++ b/test.zig @@ -0,0 +1,34 @@ +const std = @import("std"); +const ucd = @import("unicode-ucd"); + +test { + _ = &ucd.arabic_shaping.data; + _ = &ucd.bidi_brackets.data; + _ = &ucd.bidi_mirroring.data; + _ = &ucd.blocks.data; + _ = &ucd.cjk_radicals.data; + _ = &ucd.case_folding.data; + _ = &ucd.composition_exclusions.data; + _ = &ucd.derived_age.data; + _ = &ucd.derived_core_properties.data; + _ = &ucd.east_asian_width.data; + _ = &ucd.emoji_sources.data; + _ = &ucd.equivalent_unified_ideograph.data; + _ = &ucd.hangul_syllable_type.data; + _ = &ucd.indic_positional_category.data; + _ = &ucd.indic_syllabic_category.data; + _ = &ucd.jamo.data; + _ = &ucd.line_break.data; + _ = &ucd.name_aliases.data; + _ = &ucd.named_sequences.data; + _ = &ucd.named_sequences_prov.data; + _ = &ucd.prop_list.data; + _ = &ucd.scripts.data; + _ = &ucd.vertical_orientation.data; + _ = &ucd.emoji.data; + _ = &ucd.script_extensions.data; + _ = &ucd.property_aliases.data; + _ = &ucd.property_value_aliases.data; + _ = &ucd.unicode_data.data; + _ = &ucd.special_casing.data; +}