mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
Merge pull request #13218 from Luukdegram/fix-emulatable-step
std: CheckObject - correctly depend on its own step when creating an EmulatableRunStep
This commit is contained in:
commit
7d6596e979
@ -45,7 +45,9 @@ pub fn runAndCompare(self: *CheckObjectStep) *EmulatableRunStep {
|
||||
assert(dependencies_len > 0);
|
||||
const exe_step = self.step.dependencies.items[dependencies_len - 1];
|
||||
const exe = exe_step.cast(std.build.LibExeObjStep).?;
|
||||
return EmulatableRunStep.create(self.builder, "EmulatableRun", exe);
|
||||
const emulatable_step = EmulatableRunStep.create(self.builder, "EmulatableRun", exe);
|
||||
emulatable_step.step.dependOn(&self.step);
|
||||
return emulatable_step;
|
||||
}
|
||||
|
||||
/// There two types of actions currently suported:
|
||||
|
||||
@ -16,7 +16,6 @@ pub fn build(b: *Builder) void {
|
||||
const check = exe.checkObject(.macho);
|
||||
check.checkInSymtab();
|
||||
check.checkNext("{*} (__TEXT,__text) external _iAmUnused");
|
||||
test_step.dependOn(&check.step);
|
||||
|
||||
const run_cmd = check.runAndCompare();
|
||||
run_cmd.expectStdOutEqual("Hello!\n");
|
||||
@ -31,7 +30,6 @@ pub fn build(b: *Builder) void {
|
||||
const check = exe.checkObject(.macho);
|
||||
check.checkInSymtab();
|
||||
check.checkNotPresent("{*} (__TEXT,__text) external _iAmUnused");
|
||||
test_step.dependOn(&check.step);
|
||||
|
||||
const run_cmd = check.runAndCompare();
|
||||
run_cmd.expectStdOutEqual("Hello!\n");
|
||||
|
||||
@ -40,8 +40,6 @@ pub fn build(b: *Builder) void {
|
||||
check_exe.checkNext("current version 10000");
|
||||
check_exe.checkNext("compatibility version 10000");
|
||||
|
||||
test_step.dependOn(&check_exe.step);
|
||||
|
||||
check_exe.checkStart("cmd RPATH");
|
||||
check_exe.checkNext(std.fmt.allocPrint(b.allocator, "path {s}", .{b.pathFromRoot("zig-out/lib")}) catch unreachable);
|
||||
|
||||
|
||||
@ -26,7 +26,6 @@ pub fn build(b: *Builder) void {
|
||||
check_exe.checkNext("{n_value} (__TEXT,__text) external _non_main");
|
||||
|
||||
check_exe.checkComputeCompare("vmaddr entryoff +", .{ .op = .eq, .value = .{ .variable = "n_value" } });
|
||||
test_step.dependOn(&check_exe.step);
|
||||
|
||||
const run = check_exe.runAndCompare();
|
||||
run.expectStdOutEqual("42");
|
||||
|
||||
@ -31,7 +31,6 @@ pub fn build(b: *Builder) void {
|
||||
const check = exe.checkObject(.macho);
|
||||
check.checkStart("cmd LOAD_DYLIB");
|
||||
check.checkNext("name @rpath/liba.dylib");
|
||||
test_step.dependOn(&check.step);
|
||||
|
||||
const run_cmd = check.runAndCompare();
|
||||
test_step.dependOn(&run_cmd.step);
|
||||
|
||||
@ -17,7 +17,6 @@ pub fn build(b: *Builder) void {
|
||||
const check = exe.checkObject(.macho);
|
||||
check.checkStart("cmd LOAD_DYLIB");
|
||||
check.checkNext("name @rpath/liba.dylib");
|
||||
test_step.dependOn(&check.step);
|
||||
|
||||
const run = check.runAndCompare();
|
||||
run.cwd = b.pathFromRoot(".");
|
||||
|
||||
@ -18,7 +18,6 @@ pub fn build(b: *Builder) void {
|
||||
const check_exe = exe.checkObject(.macho);
|
||||
check_exe.checkStart("cmd MAIN");
|
||||
check_exe.checkNext("stacksize 100000000");
|
||||
test_step.dependOn(&check_exe.step);
|
||||
|
||||
const run = check_exe.runAndCompare();
|
||||
test_step.dependOn(&run.step);
|
||||
|
||||
@ -33,8 +33,6 @@ pub fn build(b: *Builder) void {
|
||||
check.checkNext("(undefined) weak external _a (from liba)");
|
||||
check.checkNext("(undefined) weak external _asStr (from liba)");
|
||||
|
||||
test_step.dependOn(&check.step);
|
||||
|
||||
const run_cmd = check.runAndCompare();
|
||||
run_cmd.expectStdOutEqual("42 42");
|
||||
test_step.dependOn(&run_cmd.step);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user