| author | |
| committer | |
| log | 42bc1cb3dad77c9d3e010930ba634f7b53004fc4 |
| tree | a28a1c46ec44b9bbda50bba6313226eda08ba456 |
| parent | 0ab07cc0b39951f102e3e3c6525d265ef7f76e33 |
2 files changed, 7 insertions(+), 2 deletions(-)
build.zig+5| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const string = []const u8; | ||
| 2 | const deps = @import("./deps.zig"); | 3 | const deps = @import("./deps.zig"); |
| 3 | 4 | ||
| 4 | pub fn build(b: *std.Build) void { | 5 | pub fn build(b: *std.Build) void { |
| ... | @@ -12,6 +13,10 @@ pub fn build(b: *std.Build) void { | ... | @@ -12,6 +13,10 @@ pub fn build(b: *std.Build) void { |
| 12 | }); | 13 | }); |
| 13 | deps.addAllTo(test_exe); | 14 | deps.addAllTo(test_exe); |
| 14 | 15 | ||
| 16 | const build_options = b.addOptions(); | ||
| 17 | build_options.addOption(string, "JSONTestSuite_root", deps.dirs._bebdygynna6k ++ "/test_parsing"); | ||
| 18 | test_exe.root_module.addImport("build_options", build_options.createModule()); | ||
| 19 | |||
| 15 | const test_cmd = b.addRunArtifact(test_exe); | 20 | const test_cmd = b.addRunArtifact(test_exe); |
| 16 | test_cmd.has_side_effects = true; | 21 | test_cmd.has_side_effects = true; |
| 17 | test_cmd.step.dependOn(b.getInstallStep()); | 22 | test_cmd.step.dependOn(b.getInstallStep()); |
test.zig+2-2| ... | @@ -1,5 +1,7 @@ | ... | @@ -1,5 +1,7 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const json = @import("json"); | 2 | const json = @import("json"); |
| 3 | const build_options = @import("build_options"); | ||
| 4 | const JSONTestSuite_root = build_options.JSONTestSuite_root; | ||
| 3 | 5 | ||
| 4 | fn parse_full(buffer: []const u8) !void { | 6 | fn parse_full(buffer: []const u8) !void { |
| 5 | const alloc = std.testing.allocator; | 7 | const alloc = std.testing.allocator; |
| ... | @@ -258,8 +260,6 @@ test { | ... | @@ -258,8 +260,6 @@ test { |
| 258 | ); | 260 | ); |
| 259 | } | 261 | } |
| 260 | 262 | ||
| 261 | const JSONTestSuite_root = ".zigmod/deps/v/git/github.com/nst/JSONTestSuite/commit-984defc2deaa653cb73cd29f4144a720ec9efe7c/test_parsing"; | ||
| 262 | |||
| 263 | fn expectPass(path: []const u8) !void { | 263 | fn expectPass(path: []const u8) !void { |
| 264 | const alloc = std.testing.allocator; | 264 | const alloc = std.testing.allocator; |
| 265 | var file = try std.fs.cwd().openFile(path, .{}); | 265 | var file = try std.fs.cwd().openFile(path, .{}); |