this repo has no description

make it easier to add tests to test step

altagos.dev ef43edf7 6f097d91

verified
+11 -11
+3
README.md
··· 1 + # Aeather 2 + 3 +
+8 -11
build.zig
··· 36 36 run_cmd.addArgs(args); 37 37 } 38 38 39 + const test_step = b.step("test", "Run tests"); 40 + addTest(b, test_step, mod, "aether"); 41 + addTest(b, test_step, mod_exe, "aether-exe"); 42 + } 43 + 44 + fn addTest(b: *std.Build, step: *std.Build.Step, mod: *std.Build.Module, name: ?[]const u8) void { 39 45 const mod_tests = b.addTest(.{ 40 46 .root_module = mod, 47 + .name = if (name) |n| n else "test", 41 48 }); 42 - 43 49 const run_mod_tests = b.addRunArtifact(mod_tests); 44 - 45 - const exe_tests = b.addTest(.{ 46 - .root_module = exe.root_module, 47 - }); 48 - 49 - const run_exe_tests = b.addRunArtifact(exe_tests); 50 - 51 - const test_step = b.step("test", "Run tests"); 52 - test_step.dependOn(&run_mod_tests.step); 53 - test_step.dependOn(&run_exe_tests.step); 50 + step.dependOn(&run_mod_tests.step); 54 51 }