#kcov integration

1 messages · Page 1 of 1 (latest)

balmy pebble
#

{
        const kcov_collect = std.Build.Step.Run.create(b, "collect coverage");
        kcov_collect.addArgs(&.{ "kcov", "--collect-only" });
        kcov_collect.addPrefixedDirectoryArg("--include-pattern=", b.path("src"));
        merge_step.addDirectoryArg(kcov_collect.addOutputFileArg(unit_tests.name));
        kcov_collect.addArtifactArg(unit_tests);
        kcov_collect.enableTestRunnerMode();
    }

    {
        const kcov_collect = std.Build.Step.Run.create(b, "collect coverage");
        kcov_collect.addArgs(&.{ "kcov", "--collect-only" });
        kcov_collect.addPrefixedDirectoryArg("--include-pattern=", b.path("src"));
        merge_step.addDirectoryArg(kcov_collect.addOutputFileArg(integration_tests.name));
        kcov_collect.addArtifactArg(integration_tests);
        kcov_collect.enableTestRunnerMode();
    }

    const install_coverage = b.addInstallDirectory(.{
        .source_dir = merged_coverage_output,
        .install_dir = .{ .custom = "coverage" },
        .install_subdir = "",
    });

    coverage_step.dependOn(&install_coverage.step);

tests are running with no issues, no errors from build as well
not sure whats going on

#

i can get the coverage manually from the binary and it shows valid data there, so tests are not an issue, but cant figure out whats wrong with zig build merges