lawrence-laz / neotest-zig

Test runner for Zig in Neovim using Neotest backend.
MIT License
27 stars 7 forks source link

Supporting module imports #26

Closed ziontee113 closed 5 months ago

ziontee113 commented 5 months ago

Is your feature request related to a problem? Please describe. Let's say I have a module declared in build.zig file:

    const treez = bops.b.addModule("treez", .{
        .root_source_file = bops.b.path("submodules/treez/treez.zig"),
    });

And to use that treez module, I'd have to do something like:

exe.root_module.addImport("treez", treez);

In the main file, I can use @import("treez") how.

However, the tests that gets ran by neotest-zig will run into compile time error, basically not knowing about "treez" module.

Describe the solution you'd like Maybe instead of "running a file / individual test", neotest-zig can parse the output results from zig build test or zig build test2.

lawrence-laz commented 5 months ago

This was already implemented in #4, but regressed in a recent commit. I'll try to debug and fix this is up later today.

lawrence-laz commented 5 months ago

Should be good now, let me know if something does not work as expected

ziontee113 commented 5 months ago

Thank you very much. Worked for me! I'll let you know if something come up :+1: