mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-20 11:27:22 +03:00
48b8674f5f
- 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.
36 lines
924 B
Nix
36 lines
924 B
Nix
{ stdenv, cabalProject', recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name }:
|
|
|
|
with stdenv.lib;
|
|
|
|
let
|
|
project = cabalProject' {
|
|
inherit compiler-nix-name;
|
|
index-state = "2020-05-25T00:00:00Z";
|
|
src = testSrc "cabal-source-repo";
|
|
};
|
|
packages = project.hsPkgs;
|
|
in recurseIntoAttrs {
|
|
ifdInputs = {
|
|
inherit (project) plan-nix;
|
|
};
|
|
run = stdenv.mkDerivation {
|
|
name = "call-cabal-project-to-nix-test";
|
|
|
|
buildCommand = ''
|
|
exe="${packages.use-cabal-simple.components.exes.use-cabal-simple}/bin/use-cabal-simple${stdenv.hostPlatform.extensions.executable}"
|
|
|
|
printf "checking whether executable runs... " >& 2
|
|
cat ${haskellLib.check packages.use-cabal-simple.components.exes.use-cabal-simple}/test-stdout
|
|
|
|
touch $out
|
|
'';
|
|
|
|
meta.platforms = platforms.all;
|
|
|
|
passthru = {
|
|
# Attributes used for debugging with nix repl
|
|
inherit packages;
|
|
};
|
|
};
|
|
}
|