diff --git a/freetype/build.zig b/freetype/build.zig index fa53a9ea..7e349558 100644 --- a/freetype/build.zig +++ b/freetype/build.zig @@ -76,11 +76,7 @@ pub fn build(b: *std.build.Builder) !void { .ft_config_path = "./test/ft", .brotli = true, } }); - var font_option = b.addOptions(); - - font_option.addOption([]const u8, "font", try std.fs.cwd().readFileAlloc(b.allocator, "upstream/assets/FiraSans-Regular.ttf", std.math.maxInt(u32))); - font_option.addOption([]const u8, "file", try std.fs.cwd().readFileAlloc(b.allocator, "upstream/assets/DejaVuSans.pfm", std.math.maxInt(u32))); - main_tests.addOptions("test_option", font_option); + main_tests.main_pkg_path = thisDir(); const test_step = b.step("test", "Run library tests"); test_step.dependOn(&freetype_tests.step); diff --git a/freetype/test/main.zig b/freetype/test/main.zig index bc8be31d..6b98e08e 100644 --- a/freetype/test/main.zig +++ b/freetype/test/main.zig @@ -1,9 +1,8 @@ const testing = @import("std").testing; const freetype = @import("freetype"); -const test_option = @import("test_option"); const firasans_font_path = "upstream/assets/FiraSans-Regular.ttf"; -const firasans_font_data = test_option.font; +const firasans_font_data = @embedFile("../upstream/assets/FiraSans-Regular.ttf"); // Remove once the stage2 compiler fixes pkg std not found comptime { @@ -56,7 +55,7 @@ test "attach file" { test "attach from memory" { const lib = try freetype.Library.init(); const face = try lib.newFace("upstream/assets/DejaVuSans.pfb", 0); - const file = test_option.file; + const file = @embedFile("../upstream/assets/DejaVuSans.pfm"); try face.attachMemory(file); }