File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -98,20 +98,22 @@ pub fn build(b: *std.Build) void {
98
98
99
99
// ----------------------------- Code Coverage -----------------------------
100
100
101
+ const kcov_bin = b .findProgram (&.{"kcov" }, &.{}) catch "kcov" ;
102
+
101
103
const addOutputDirectoryArg = comptime if (@import ("builtin" ).zig_version .order (.{ .major = 0 , .minor = 13 , .patch = 0 }) == .lt )
102
104
std .Build .Step .Run .addOutputFileArg
103
105
else
104
106
std .Build .Step .Run .addOutputDirectoryArg ;
105
107
106
108
const kcov_merge = std .Build .Step .Run .create (b , "kcov merge coverage" );
107
109
kcov_merge .rename_step_with_output_arg = false ;
108
- kcov_merge .addArg ("kcov" );
110
+ kcov_merge .addArg (kcov_bin );
109
111
kcov_merge .addArg ("--merge" );
110
112
const coverage_output = addOutputDirectoryArg (kcov_merge , "." );
111
113
112
114
for ([_ ]* std.Build.Step.Compile { lsp_tests , lsp_parser_tests }) | test_artifact | {
113
115
const kcov_collect = std .Build .Step .Run .create (b , "kcov collect coverage" );
114
- kcov_collect .addArg ("kcov" );
116
+ kcov_collect .addArg (kcov_bin );
115
117
kcov_collect .addArg ("--collect-only" );
116
118
kcov_collect .addPrefixedDirectoryArg ("--include-pattern=" , b .path ("." ));
117
119
kcov_merge .addDirectoryArg (addOutputDirectoryArg (kcov_collect , test_artifact .name ));
You can’t perform that action at this time.
0 commit comments