Skip to content

build runner prints "failed command" when testing #6

@genos

Description

@genos

First off, thank you very much for this library! As a zig newbie, having a property-based testing library is so helpful.

Describe the bug
Due to what I suspect is described in the ziglang repo here, when I run minish-enabled tests with zig build test in my code, I get something like

test
└─ run test w
OK. 100 tests passed.
failed command: ./.zig-cache/o/b95d4eb9425be31e19e7b96b315bfc36/test --cache-dir=./.zig-cache --seed=0xe35c8051 --listen=-

due to, I suspect, the use of std.debug.print in minish/runner.zig.

To Reproduce
Steps to reproduce the behavior:

  1. Add minish to my build.zig per the README and fetch it with zig fetch.
  2. Write a property test; in my little example, I've got the following to demonstrate the equivalence of two different versions of an algorithm:
test "equivalence" {
    const minish = @import("minish");
    const tuple_gen = minish.gen.tuple2(u64, u64, minish.gen.int(u64), minish.gen.int(u64));
    try minish.check(std.testing.allocator, tuple_gen, struct {
        fn f(t: struct { u64, u64 }) !void {
            var a, var n = t;
            const m: u64 = 1e9 + 7;
            a %= m;
            n %= m;
            try std.testing.expectEqual(recursive(a, n, m), iterative(a, n, m));
            try std.testing.expectEqual(inv(a, m, recursive), inv(a, m, iterative));
        }
    }.f, .{});
}
  1. Run zig build test

Expected behavior
No warnings about "failed" things when the test passes.

Additional context
This is on zig 0.16.0.

Thanks again!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions