authorgravatar for michaldrozd@protonmail.chfardragon <michaldrozd@protonmail.ch> 2026-06-04 18:33:59+00:00
committergravatar for michaldrozd@protonmail.chfardragon <michaldrozd@protonmail.ch> 2026-06-05 14:59:18+02:00
logcf741692f7c34b1bd3269fdd7437903bad64804d
treebf4ca4f9b0b0ede56757e8c93af39f6d360ffcb5
parentd80b072bf29620753fb36b8053c6e81500526fb6

Add coverage for blank and nasm styles


3 files changed, 68 insertions(+), 0 deletions(-)

test/standalone/config_header/blank/config.h created+13
...@@ -0,0 +1,13 @@
1/* This file was generated by ConfigHeader using the Zig Build System. */
2#ifndef CONFIG_H
3#define CONFIG_H
4/* #undef UNDEFINED */
5#define DEFINED
6#define TRUE 1
7#define FALSE 0
8#define ZERO 0
9#define ONE 1
10#define TEN 10
11#define IDENT identifier
12#define STRING "test"
13#endif /* CONFIG_H */
test/standalone/config_header/build.zig+45
...@@ -50,6 +50,51 @@ pub fn build(b: *std.Build) void {...@@ -50,6 +50,51 @@ pub fn build(b: *std.Build) void {
5050
51 test_step.dependOn(&check_config_header.step);51 test_step.dependOn(&check_config_header.step);
52 test_step.dependOn(&check_config_header_autoconf_at.step);52 test_step.dependOn(&check_config_header_autoconf_at.step);
53
54 const config_header_blank = b.addConfigHeader(
55 .{
56 .style = .blank,
57 .include_path = "config.h",
58 },
59 .{
60 .UNDEFINED = null,
61 .DEFINED = {},
62 .TRUE = true,
63 .FALSE = false,
64 .ZERO = 0,
65 .ONE = 1,
66 .TEN = 10,
67 .IDENT = @as(enum { identifier }, .identifier),
68 .STRING = "test",
69 },
70 );
71 const check_config_header_blank = b.addCheckFile(config_header_blank.getOutputFile(), .{
72 .expected_exact = @embedFile("blank/config.h"),
73 });
74 test_step.dependOn(&check_config_header_blank.step);
75
76 const config_header_nasm = b.addConfigHeader(
77 .{
78 .style = .nasm,
79 .include_path = "config.asm",
80 },
81 .{
82 .UNDEFINED = null,
83 .DEFINED = {},
84 .TRUE = true,
85 .FALSE = false,
86 .ZERO = 0,
87 .ONE = 1,
88 .TEN = 10,
89 .IDENT = @as(enum { identifier }, .identifier),
90 .STRING = "test",
91 },
92 );
93 const check_config_header_nasm = b.addCheckFile(config_header_nasm.getOutputFile(), .{
94 .expected_exact = @embedFile("nasm/config.asm"),
95 });
96 test_step.dependOn(&check_config_header_nasm.step);
97
53 addCmakeChecks(b, test_step);98 addCmakeChecks(b, test_step);
54}99}
55100
test/standalone/config_header/nasm/config.asm created+10
...@@ -0,0 +1,10 @@
1; This file was generated by ConfigHeader using the Zig Build System.
2; %undef UNDEFINED
3%define DEFINED
4%define TRUE 1
5%define FALSE 0
6%define ZERO 0
7%define ONE 1
8%define TEN 10
9%define IDENT identifier
10%define STRING "test"