diff --git a/test/standalone/config_header/autoconf_at/autoconf_at.h b/test/standalone/config_header/autoconf_at/autoconf_at.h new file mode 100644 index 0000000000000000000000000000000000000000..a4bdeff7af89c8b3c8b14d19abfae016692a2249 --- /dev/null +++ b/test/standalone/config_header/autoconf_at/autoconf_at.h @@ -0,0 +1,63 @@ +/* This file was generated by ConfigHeader using the Zig Build System. */ +/* Some Comment */ +int foo(); +// empty strings are preserved + +// line with misc content is preserved +#define KEPT_VALUE no substitution + +// empty @ sigils are preserved +#define AT_SIGIL_1 @ +#define AT_SIGIL_2 @@ +#define AT_SIGIL_3 @@@ +#define AT_SIGIL_4 @@@@ + +// simple substitution +#define SIMPLE_UNDEFINED +#define SIMPLE_DEFINED +#define SIMPLE_BOOL_TRUE 1 +#define SIMPLE_BOOL_FALSE 0 +#define SIMPLE_INTEGER 42 +#define SIMPLE_STRING text + +// double packed substitution +#define DOUBLE_PACKED texttext + +// triple packed substitution +#define TRIPLE_PACKED text42text + +// double separated substitution +#define DOUBLE_SEPARATED 42.42 + +// triple separated substitution +#define TRIPLE_SEPARATED 42.1.42 + +// misc prefix is preserved +#define MISC_PREFIX false is 0 + +// misc suffix is preserved +#define MISC_SUFFIX 1 is true + +// surrounding content is preserved +#define SURROUNDING what is 6*7? 42! + +// incomplete key is preserved +#define INCOMPLETE_KEY @undefined + +// @-vars resolved only when they wrap valid characters, otherwise considered literals +#define DOUBLE_WRAPPED @text@ + +// expanded variables are considered strings after expansion +#define EXPANDED_STRING @string@ + +// variable name with underscores +#define UNDERSCORED_VAR value + +// backslash before at-sigil does not prevent resolution +#define BACKSLASH_AT \text + +// value that is an at-sign itself +#define AT_SIGN_VALUE @ + +// incomplete key mid-line is preserved, trailing content kept +#define INCOMPLETE_MID @incomplete trailing content diff --git a/test/standalone/config_header/autoconf_at/autoconf_at.h.in b/test/standalone/config_header/autoconf_at/autoconf_at.h.in new file mode 100644 index 0000000000000000000000000000000000000000..3c7967a61eba0ba3e2276cd19eedf12bb466f118 --- /dev/null +++ b/test/standalone/config_header/autoconf_at/autoconf_at.h.in @@ -0,0 +1,62 @@ +/* Some Comment */ +int foo(); +// empty strings are preserved + +// line with misc content is preserved +#define KEPT_VALUE no substitution + +// empty @ sigils are preserved +#define AT_SIGIL_1 @ +#define AT_SIGIL_2 @@ +#define AT_SIGIL_3 @@@ +#define AT_SIGIL_4 @@@@ + +// simple substitution +#define SIMPLE_UNDEFINED @undefined@ +#define SIMPLE_DEFINED @defined@ +#define SIMPLE_BOOL_TRUE @boolean_true@ +#define SIMPLE_BOOL_FALSE @boolean_false@ +#define SIMPLE_INTEGER @integer@ +#define SIMPLE_STRING @string@ + +// double packed substitution +#define DOUBLE_PACKED @string@@string@ + +// triple packed substitution +#define TRIPLE_PACKED @string@@integer@@string@ + +// double separated substitution +#define DOUBLE_SEPARATED @integer@.@integer@ + +// triple separated substitution +#define TRIPLE_SEPARATED @integer@.@boolean_true@.@integer@ + +// misc prefix is preserved +#define MISC_PREFIX false is @boolean_false@ + +// misc suffix is preserved +#define MISC_SUFFIX @boolean_true@ is true + +// surrounding content is preserved +#define SURROUNDING what is 6*7? @integer@! + +// incomplete key is preserved +#define INCOMPLETE_KEY @undefined + +// @-vars resolved only when they wrap valid characters, otherwise considered literals +#define DOUBLE_WRAPPED @@string@@ + +// expanded variables are considered strings after expansion +#define EXPANDED_STRING @string_at@ + +// variable name with underscores +#define UNDERSCORED_VAR @underscored_var@ + +// backslash before at-sigil does not prevent resolution +#define BACKSLASH_AT \@string@ + +// value that is an at-sign itself +#define AT_SIGN_VALUE @at_sign@ + +// incomplete key mid-line is preserved, trailing content kept +#define INCOMPLETE_MID @incomplete trailing content diff --git a/test/standalone/config_header/autoconf_at/autoconf_at.txt b/test/standalone/config_header/autoconf_at/autoconf_at.txt deleted file mode 100644 index e35cb5f822ab889e727d0fd13fe263fedb8b24cd..0000000000000000000000000000000000000000 --- a/test/standalone/config_header/autoconf_at/autoconf_at.txt +++ /dev/null @@ -1,49 +0,0 @@ -/* This file was generated by ConfigHeader using the Zig Build System. */ -// empty strings are preserved - -// line with misc content is preserved -no substitution -// empty @ sigils are preserved -@ -@@ -@@@ -@@@@ -// simple substitution - - -1 -0 -42 -text -// double packed substitution -texttext -// triple packed substitution -text42text -// double separated substitution -42.42 -// triple separated substitution -42.1.42 -// misc prefix is preserved -false is 0 -// misc suffix is preserved -1 is true -// surrounding content is preserved -what is 6*7? 42! -// incomplete key is preserved -@undefined -// @-vars resolved only when they wrap valid characters, otherwise considered literals -@text@ -// expanded variables are considered strings after expansion -@string@ - -// variable name with underscores -value - -// backslash before at-sigil does not prevent resolution -\text - -// value that is an at-sign itself -@ - -// incomplete key mid-line is preserved, trailing content kept -@incomplete trailing content diff --git a/test/standalone/config_header/autoconf_at/autoconf_at.txt.in b/test/standalone/config_header/autoconf_at/autoconf_at.txt.in deleted file mode 100644 index 77d15622e8223e3e51ccc66889deb2b0d79b563b..0000000000000000000000000000000000000000 --- a/test/standalone/config_header/autoconf_at/autoconf_at.txt.in +++ /dev/null @@ -1,48 +0,0 @@ -// empty strings are preserved - -// line with misc content is preserved -no substitution -// empty @ sigils are preserved -@ -@@ -@@@ -@@@@ -// simple substitution -@undefined@ -@defined@ -@boolean_true@ -@boolean_false@ -@integer@ -@string@ -// double packed substitution -@string@@string@ -// triple packed substitution -@string@@integer@@string@ -// double separated substitution -@integer@.@integer@ -// triple separated substitution -@integer@.@boolean_true@.@integer@ -// misc prefix is preserved -false is @boolean_false@ -// misc suffix is preserved -@boolean_true@ is true -// surrounding content is preserved -what is 6*7? @integer@! -// incomplete key is preserved -@undefined -// @-vars resolved only when they wrap valid characters, otherwise considered literals -@@string@@ -// expanded variables are considered strings after expansion -@string_at@ - -// variable name with underscores -@underscored_var@ - -// backslash before at-sigil does not prevent resolution -\@string@ - -// value that is an at-sign itself -@at_sign@ - -// incomplete key mid-line is preserved, trailing content kept -@incomplete trailing content diff --git a/test/standalone/config_header/build.zig b/test/standalone/config_header/build.zig index 95daf60c28ea3aa5032377c7cb5c14f082a622a9..84439ba34cd7d97ae6cef9c9df99e2e0e9df5cd3 100644 --- a/test/standalone/config_header/build.zig +++ b/test/standalone/config_header/build.zig @@ -30,7 +30,7 @@ pub fn build(b: *std.Build) void { }); const config_header_autoconf_at = b.addConfigHeader( - .{ .style = .{ .autoconf_at = b.path("autoconf_at/autoconf_at.txt.in") } }, + .{ .style = .{ .autoconf_at = b.path("autoconf_at/autoconf_at.h.in") } }, .{ .undefined = null, .defined = {}, @@ -45,7 +45,7 @@ pub fn build(b: *std.Build) void { }, ); const check_config_header_autoconf_at = b.addCheckFile(config_header_autoconf_at.getOutputFile(), .{ - .expected_exact = @embedFile("autoconf_at/autoconf_at.txt"), + .expected_exact = @embedFile("autoconf_at/autoconf_at.h"), }); test_step.dependOn(&check_config_header.step);