aboutsummaryrefslogtreecommitdiffstats
path: root/coverage.nix
blob: ed03ce8169bbe7d8c7e46097c35b84907a2641fa (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ pkgs ? import ./nixpkgs-pinned.nix {} }:
(import ./default.nix { inherit pkgs; }).overrideAttrs (final: prev: {
  name = "mininix-coverage";

  nativeBuildInputs = prev.nativeBuildInputs ++ [
    pkgs.ocaml-ng.ocamlPackages_4_14.bisect_ppx
  ];

  checkPhase = ''
    dune test --instrument-with bisect_ppx --force
  '';

  installPhase = ''
    mkdir -p $out/coverage
    bisect-ppx-report summary --per-file > $out/coverage/report-plain
    bisect-ppx-report html
    cp -R _coverage $out/coverage/html/
  '';
})