Commit 294ca6563e

Robin Voetter <robin@voetter.nl>
2024-08-18 15:02:24
add standalone test for only dependending on the emitted assembly and not the bin
1 parent b434307
Changed files (3)
test
standalone
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);
+}
test/standalone/emit_asm_no_bin/main.zig
@@ -0,0 +1,1 @@
+pub fn main() void {}
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",
         },