authorgravatar for michaldrozd@protonmail.chfardragon <michaldrozd@protonmail.ch> 2026-06-04 18:26:14+00:00
committergravatar for michaldrozd@protonmail.chfardragon <michaldrozd@protonmail.ch> 2026-06-05 14:59:18+02:00
logd80b072bf29620753fb36b8053c6e81500526fb6
treedb6ec7ef2db9628dea49875dedecd7c81cdac399
parent0804feac00ce4aff2ae746f4246d1675b6b4e491

add more coverage for autoconf style


5 files changed, 53 insertions(+), 3 deletions(-)

test/standalone/config_header/autoconf_at/autoconf_at.txt+12
......@@ -35,3 +35,15 @@ what is 6*7? 42!
3535@text@
3636// expanded variables are considered strings after expansion
3737@string@
38
39// variable name with underscores
40value
41
42// backslash before at-sigil does not prevent resolution
43\text
44
45// value that is an at-sign itself
46@
47
48// incomplete key mid-line is preserved, trailing content kept
49@incomplete trailing content
test/standalone/config_header/autoconf_at/autoconf_at.txt.in+12
......@@ -34,3 +34,15 @@ what is 6*7? @integer@!
3434@@string@@
3535// expanded variables are considered strings after expansion
3636@string_at@
37
38// variable name with underscores
39@underscored_var@
40
41// backslash before at-sigil does not prevent resolution
42\@string@
43
44// value that is an at-sign itself
45@at_sign@
46
47// incomplete key mid-line is preserved, trailing content kept
48@incomplete trailing content
test/standalone/config_header/autoconf_undef/config.h+11
......@@ -20,4 +20,15 @@ int foo();
2020/* #undef PREFIX_TAB */
2121/* #undef POSTFIX_SPACE */
2222/* #undef POSTFIX_TAB */
23
24// #undef with underscored variable name
25#define SOME_UNDERSCORED 1
26
27// #undef with extra tokens after variable name (ignored)
28#define SOME_ONE 1
29
30// non-#undef # lines pass through unchanged
31#define KEPT_DEFINE value
32#include <kept.h>
2333// TODO: unexpected newline is being added here
34
test/standalone/config_header/autoconf_undef/config.h.in+13-3
......@@ -17,6 +17,16 @@ int foo();
1717
1818#undef PREFIX_SPACE
1919#undef PREFIX_TAB
20#undef POSTFIX_SPACE
21#undef POSTFIX_TAB
22// TODO: unexpected newline is being added here
\ No newline at end of file
20#undef POSTFIX_SPACE
21#undef POSTFIX_TAB
22
23// #undef with underscored variable name
24#undef SOME_UNDERSCORED
25
26// #undef with extra tokens after variable name (ignored)
27#undef SOME_ONE extra ignored tokens
28
29// non-#undef # lines pass through unchanged
30#define KEPT_DEFINE value
31#include <kept.h>
32// TODO: unexpected newline is being added here
test/standalone/config_header/build.zig+5
......@@ -21,6 +21,8 @@ pub fn build(b: *std.Build) void {
2121 .PREFIX_TAB = null,
2222 .POSTFIX_SPACE = null,
2323 .POSTFIX_TAB = null,
24
25 .SOME_UNDERSCORED = true,
2426 },
2527 );
2628 const check_config_header = b.addCheckFile(config_header.getOutputFile(), .{
......@@ -37,6 +39,9 @@ pub fn build(b: *std.Build) void {
3739 .integer = 42,
3840 .string = "text",
3941 .string_at = "@string@",
42
43 .underscored_var = "value",
44 .at_sign = "@",
4045 },
4146 );
4247 const check_config_header_autoconf_at = b.addCheckFile(config_header_autoconf_at.getOutputFile(), .{