| ... | @@ -1,6 +1,9 @@ | ... | @@ -1,6 +1,9 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | | 2 | |
| 3 | pub fn build(b: *std.Build) void { | 3 | pub fn build(b: *std.Build) void { |
| | 4 | const test_step = b.step("test", "Test it"); |
| | 5 | b.default_step = test_step; |
| | 6 | |
| 4 | const config_header = b.addConfigHeader( | 7 | const config_header = b.addConfigHeader( |
| 5 | .{ .style = .{ .autoconf_undef = b.path("config.h.in") } }, | 8 | .{ .style = .{ .autoconf_undef = b.path("config.h.in") } }, |
| 6 | .{ | 9 | .{ |
| ... | @@ -23,6 +26,24 @@ pub fn build(b: *std.Build) void { | ... | @@ -23,6 +26,24 @@ pub fn build(b: *std.Build) void { |
| 23 | | 26 | |
| 24 | const check_config_header = b.addCheckFile(config_header.getOutputFile(), .{ .expected_exact = @embedFile("config.h") }); | 27 | const check_config_header = b.addCheckFile(config_header.getOutputFile(), .{ .expected_exact = @embedFile("config.h") }); |
| 25 | | 28 | |
| 26 | const test_step = b.step("test", "Test it"); | 29 | const config_header_autoconf_at = b.addConfigHeader( |
| | 30 | .{ .style = .{ |
| | 31 | .autoconf_at = b.path("autoconf_at/autoconf_at.txt.in"), |
| | 32 | } }, |
| | 33 | .{ |
| | 34 | .undefined = null, |
| | 35 | .defined = {}, |
| | 36 | .boolean_true = true, |
| | 37 | .boolean_false = false, |
| | 38 | .integer = 42, |
| | 39 | .string = "text", |
| | 40 | .string_at = "@string@", |
| | 41 | }, |
| | 42 | ); |
| | 43 | const check_config_header_autoconf_at = b.addCheckFile(config_header_autoconf_at.getOutputFile(), .{ |
| | 44 | .expected_exact = @embedFile("autoconf_at/autoconf_at.txt"), |
| | 45 | }); |
| | 46 | |
| 27 | test_step.dependOn(&check_config_header.step); | 47 | test_step.dependOn(&check_config_header.step); |
| | 48 | test_step.dependOn(&check_config_header_autoconf_at.step); |
| 28 | } | 49 | } |