Skip to content

Commit

Permalink
resolve the correct build runner path in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Mar 5, 2025
1 parent 632ef59 commit 81407cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,11 @@ pub fn build(b: *Build) !void {
const test_build_runner_step = b.step("test-build-runner", "Run all the build runner tests");
const test_analysis_step = b.step("test-analysis", "Run all the analysis tests");

const latest_build_runner_version = std.meta.fieldNames(@import("src/build_runner/BuildRunnerVersion.zig").BuildRunnerVersion)[0];
const build_runner = b.path(b.fmt("src/build_runner/{s}.zig", .{latest_build_runner_version}));

// Create run steps
@import("tests/add_build_runner_cases.zig").addCases(b, test_build_runner_step, test_filters);
@import("tests/add_build_runner_cases.zig").addCases(b, test_build_runner_step, test_filters, build_runner);
@import("tests/add_analysis_cases.zig").addCases(b, test_analysis_step, test_filters);

const run_tests = b.addRunArtifact(tests);
Expand Down
2 changes: 1 addition & 1 deletion tests/add_build_runner_cases.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pub fn addCases(
b: *std.Build,
test_step: *std.Build.Step,
test_filters: []const []const u8,
build_runner: std.Build.LazyPath,
) void {
const build_runner = b.path("src/build_runner/master.zig");
const cases_dir = b.path("tests/build_runner_cases");
const cases_path_from_root = b.pathFromRoot("tests/build_runner_cases");

Expand Down

0 comments on commit 81407cd

Please sign in to comment.