add standalone test for only dependending on the emitted assembly and not the bin

This commit is contained in:
Robin Voetter 2024-08-18 15:02:24 +02:00
parent b4343074d2
commit 294ca6563e
No known key found for this signature in database
3 changed files with 23 additions and 0 deletions

View File

@ -59,6 +59,9 @@
//.issue_12588 = .{
// .path = "issue_12588",
//},
.emit_asm_no_bin = .{
.path = "emit_asm_no_bin",
},
.child_process = .{
.path = "child_process",
},

View File

@ -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);
}

View File

@ -0,0 +1 @@
pub fn main() void {}