diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-03 13:39:30 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-03 13:57:08 +0100 |
commit | 497997cc388ce791ca0b4dc55f46ab515e8fb5d9 (patch) | |
tree | 867053bb31858180d2b439d1c63c610c58be54ee /pkgs/stdenv/adapters.nix | |
parent | ad7c518e45221533e2094acb20fea6ade477da75 (diff) |
Move generation of coverage reports from nixos/lib/testing to releaseTools
Also, turn some stdenv adapters into setup hooks.
Diffstat (limited to 'pkgs/stdenv/adapters.nix')
-rw-r--r-- | pkgs/stdenv/adapters.nix | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index cb7e3ba925f56..0e45ad05531c5 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -187,51 +187,13 @@ rec { { mkDerivation = args: stdenv.mkDerivation (args // extraAttrs); }; - /* Return a modified stdenv that performs the build under $out/.build - instead of in $TMPDIR. Thus, the sources are kept available. - This is useful for things like debugging or generation of - dynamic analysis reports. */ - keepBuildTree = stdenv: - addAttrsToDerivation - { prePhases = "moveBuildDir"; - - moveBuildDir = - '' - mkdir -p $out/.build - cd $out/.build - ''; - } stdenv; - - - cleanupBuildTree = stdenv: - addAttrsToDerivation - { postPhases = "cleanupBuildDir"; - - # Get rid of everything that isn't a gcno file or a C source - # file. This also includes the gcda files; we're not - # interested in coverage resulting from the package's own test - # suite. Also strip the `.tmp_' prefix from gcno files. (The - # Linux kernel creates these.) - cleanupBuildDir = - '' - find $out/.build/ -type f -a ! \ - \( -name "*.c" -o -name "*.h" -o -name "*.gcno" \) \ - | xargs rm -f -- - - for i in $(find $out/.build/ -name ".tmp_*.gcno"); do - mv "$i" "$(echo $i | sed s/.tmp_//)" - done - ''; - } stdenv; - - /* Return a modified stdenv that builds packages with GCC's coverage instrumentation. The coverage note files (*.gcno) are stored in $out/.build, along with the source code of the package, to enable programs like lcov to produce pretty-printed reports. */ addCoverageInstrumentation = stdenv: - cleanupBuildTree (keepBuildTree (overrideInStdenv stdenv [ pkgs.enableCoverageInstrumentation ])); + overrideInStdenv stdenv [ pkgs.enableGCOVInstrumentation pkgs.keepBuildTree ]; /* Replace the meta.maintainers field of a derivation. This is useful |