zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 3dfa0c8df165849246c6938fd61a1d9605f8ddeb (tree)
parent 660b3e20907ccfc169dd07e25d4a7a13a0551e9f
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri, 25 Aug 2023 12:57:51 -0700

c_compiler standalone test: use more descriptive exe names

Diffstat:
Mtest/standalone/c_compiler/build.zig | 20+++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/test/standalone/c_compiler/build.zig b/test/standalone/c_compiler/build.zig @@ -5,17 +5,23 @@ pub fn build(b: *std.Build) void { const test_step = b.step("test", "Test it"); b.default_step = test_step; - add(b, test_step, .Debug); - add(b, test_step, .ReleaseFast); - add(b, test_step, .ReleaseSmall); - add(b, test_step, .ReleaseSafe); + add(b, test_step, "test_c_Debug", "test_cpp_Debug", .Debug); + add(b, test_step, "test_c_ReleaseFast", "test_cpp_ReleaseFast", .ReleaseFast); + add(b, test_step, "test_c_ReleaseSmall", "test_cpp_ReleaseSmall", .ReleaseSmall); + add(b, test_step, "test_c_ReleaseSafe", "test_cpp_ReleaseSafe", .ReleaseSafe); } -fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void { +fn add( + b: *std.Build, + test_step: *std.Build.Step, + c_name: []const u8, + cpp_name: []const u8, + optimize: std.builtin.OptimizeMode, +) void { const target: std.zig.CrossTarget = .{}; const exe_c = b.addExecutable(.{ - .name = "test_c", + .name = c_name, .optimize = optimize, .target = target, }); @@ -23,7 +29,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize exe_c.linkLibC(); const exe_cpp = b.addExecutable(.{ - .name = "test_cpp", + .name = cpp_name, .optimize = optimize, .target = target, });