haskell.nix/test/project-flags/stack.nix
Samuel Evans-Powell 48b8674f5f
Add support for coverage (#762)
- Added the ability to generate coverage reports for packages and
  projects.
  - Outputs mix and tix information, as well as a HTML report.
- Added the "doCoverage" module option that allows users to choose
  packages to enable coverage for.
- Added a "doCoverage" flag to the component builder that outputs HPC
  information when coverage is enabled.
- Added the "overrideModules" library function to make it more
  ergonomic fo users to enable coverage on existing projects.
- Modified the "check" builder to also output ".tix" files (if they
  exist). This information is required to generate the coverage
  report.
- Added a test for coverage.
2020-09-29 11:56:24 +08:00

36 lines
877 B
Nix

{ stdenv, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
with stdenv.lib;
let
project = stackProject' {
src = testSrc "project-flags";
};
packages = project.hsPkgs;
in recurseIntoAttrs {
ifdInputs = {
inherit (project) stack-nix;
};
run = stdenv.mkDerivation {
name = "callStackToNix-test";
buildCommand = ''
exe="${packages.test-project-flags.components.exes.test-project-flags-exe}/bin/test-project-flags-exe${stdenv.hostPlatform.extensions.executable}"
printf "checking whether executable runs... " >& 2
cat ${haskellLib.check packages.test-project-flags.components.exes.test-project-flags-exe}/test-stdout
touch $out
'';
meta.platforms = platforms.all;
passthru = {
# Attributes used for debugging with nix repl
inherit pkgSet packages;
stack-nix = stack.nix;
};
};
}