From cf741692f7c34b1bd3269fdd7437903bad64804d Mon Sep 17 00:00:00 2001 From: fardragon Date: Thu, 4 Jun 2026 18:33:59 +0000 Subject: [PATCH] Add coverage for blank and nasm styles --- test/standalone/config_header/blank/config.h | 13 ++++++ test/standalone/config_header/build.zig | 45 +++++++++++++++++++ test/standalone/config_header/nasm/config.asm | 10 +++++ 3 files changed, 68 insertions(+) create mode 100644 test/standalone/config_header/blank/config.h create mode 100644 test/standalone/config_header/nasm/config.asm diff --git a/test/standalone/config_header/blank/config.h b/test/standalone/config_header/blank/config.h new file mode 100644 index 0000000000000000000000000000000000000000..d5778c5bf642920877939cf1bd3fc3e4e606725d --- /dev/null +++ b/test/standalone/config_header/blank/config.h @@ -0,0 +1,13 @@ +/* This file was generated by ConfigHeader using the Zig Build System. */ +#ifndef CONFIG_H +#define CONFIG_H +/* #undef UNDEFINED */ +#define DEFINED +#define TRUE 1 +#define FALSE 0 +#define ZERO 0 +#define ONE 1 +#define TEN 10 +#define IDENT identifier +#define STRING "test" +#endif /* CONFIG_H */ diff --git a/test/standalone/config_header/build.zig b/test/standalone/config_header/build.zig index 42080a0996c2b330a73ff5ad721be8a3d120e15b..95daf60c28ea3aa5032377c7cb5c14f082a622a9 100644 --- a/test/standalone/config_header/build.zig +++ b/test/standalone/config_header/build.zig @@ -50,6 +50,51 @@ pub fn build(b: *std.Build) void { test_step.dependOn(&check_config_header.step); test_step.dependOn(&check_config_header_autoconf_at.step); + + const config_header_blank = b.addConfigHeader( + .{ + .style = .blank, + .include_path = "config.h", + }, + .{ + .UNDEFINED = null, + .DEFINED = {}, + .TRUE = true, + .FALSE = false, + .ZERO = 0, + .ONE = 1, + .TEN = 10, + .IDENT = @as(enum { identifier }, .identifier), + .STRING = "test", + }, + ); + const check_config_header_blank = b.addCheckFile(config_header_blank.getOutputFile(), .{ + .expected_exact = @embedFile("blank/config.h"), + }); + test_step.dependOn(&check_config_header_blank.step); + + const config_header_nasm = b.addConfigHeader( + .{ + .style = .nasm, + .include_path = "config.asm", + }, + .{ + .UNDEFINED = null, + .DEFINED = {}, + .TRUE = true, + .FALSE = false, + .ZERO = 0, + .ONE = 1, + .TEN = 10, + .IDENT = @as(enum { identifier }, .identifier), + .STRING = "test", + }, + ); + const check_config_header_nasm = b.addCheckFile(config_header_nasm.getOutputFile(), .{ + .expected_exact = @embedFile("nasm/config.asm"), + }); + test_step.dependOn(&check_config_header_nasm.step); + addCmakeChecks(b, test_step); } diff --git a/test/standalone/config_header/nasm/config.asm b/test/standalone/config_header/nasm/config.asm new file mode 100644 index 0000000000000000000000000000000000000000..ffc7acf6859435ab1124efa700c93a6781fb2032 --- /dev/null +++ b/test/standalone/config_header/nasm/config.asm @@ -0,0 +1,10 @@ +; This file was generated by ConfigHeader using the Zig Build System. +; %undef UNDEFINED +%define DEFINED +%define TRUE 1 +%define FALSE 0 +%define ZERO 0 +%define ONE 1 +%define TEN 10 +%define IDENT identifier +%define STRING "test" -- 2.54.0