Skip to content
Closed
5 changes: 5 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ pub fn build(b: *std.Build) void {
const minish_seed: ?u64 = minish_seed_override orelse gitHeadSeed(b);
test_options.addOption(?u64, "minish_seed", minish_seed);

// Off by default: the format-experiment test shells out to `git merge-file`
// 400+ times and ~doubles the test-suite wall time.
const run_format_experiment = b.option(bool, "format-experiment", "Run the lockfile format experiment test") orelse false;
test_options.addOption(bool, "run_format_experiment", run_format_experiment);

// Helpers module for integration tests
const helpers_module = b.createModule(.{
.root_source_file = b.path("test/helpers.zig"),
Expand Down
4 changes: 4 additions & 0 deletions test/helpers.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const payload = @import("payload");
/// Null falls back to minish's timestamp seed. Override with `-Dminish-seed=N`.
pub const minish_seed: ?u64 = build_options.minish_seed;

/// Whether the opt-in format-experiment test should run. Off by default since
/// it ~doubles the test-suite wall time. Enable with `-Dformat-experiment=true`.
pub const run_format_experiment: bool = build_options.run_format_experiment;

/// Result returned by runDrift.
pub const ExecResult = struct {
stdout: []const u8,
Expand Down
Loading
Loading