commit 294ca6563ea5efeec3ab30f27a06c05c2a657f80 (tree)
parent b4343074d2d6ee81f8e589395a9c045031b86b83
Author: Robin Voetter <robin@voetter.nl>
Date: Sun, 18 Aug 2024 15:02:24 +0200
add standalone test for only dependending on the emitted assembly and not the bin
Diffstat:
3 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/test/standalone/build.zig.zon b/test/standalone/build.zig.zon
@@ -59,6 +59,9 @@
//.issue_12588 = .{
// .path = "issue_12588",
//},
+ .emit_asm_no_bin = .{
+ .path = "emit_asm_no_bin",
+ },
.child_process = .{
.path = "child_process",
},
diff --git a/test/standalone/emit_asm_no_bin/build.zig b/test/standalone/emit_asm_no_bin/build.zig
@@ -0,0 +1,19 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) void {
+ const test_step = b.step("test", "Test it");
+ b.default_step = test_step;
+
+ const optimize: std.builtin.OptimizeMode = .Debug;
+
+ const obj = b.addObject(.{
+ .name = "main",
+ .root_source_file = b.path("main.zig"),
+ .optimize = optimize,
+ .target = b.graph.host,
+ });
+ _ = obj.getEmittedAsm();
+ b.default_step.dependOn(&obj.step);
+
+ test_step.dependOn(&obj.step);
+}
diff --git a/test/standalone/emit_asm_no_bin/main.zig b/test/standalone/emit_asm_no_bin/main.zig
@@ -0,0 +1 @@
+pub fn main() void {}