general-tests: 595f87fe8d08ff8b9831d3674158db7a24c08bc3

     1: { pkgs, helpers }:
     2: with builtins;
     3: with pkgs;
     4: with lib;
     5: with rec {
     6:   env = withNix {};
     7: 
     8:   testRepo = pkgName: repo:
     9:     with { cfg = helpers.haskellDeps.utils.phaseConfig pkgName "coverage"; };
    10:     wrap {
    11:       name  = "cabal-test-${pkgName}";
    12:       paths =
    13:         with rec {
    14:           # Look up an appropriate version of GHC for this package, if specified
    15:           hsVer  = cfg.ghc or null;
    16:           hsPkgs = if cfg ? ghc
    17:                       then getAttr cfg.ghc haskell.packages
    18:                       else haskellPackages;
    19:         };
    20:         concatLists [
    21:           [ bash cabal-install2 fail findutils hsPkgs.ghc ]
    22:           (cfg.buildInputs or [])
    23:           env.buildInputs
    24:         ];
    25:       vars  = env // {
    26:         inherit pkgName repo;
    27:         extra = helpers.haskellDeps.utils.genCabalProjectLocal cfg;
    28:       };
    29:       script = ''
    30:         #!/usr/bin/env bash
    31:         set -e
    32: 
    33:         ${helpers.initHaskellTest}
    34: 
    35:         if [[ -e shell.nix ]]
    36:         then
    37:           nix-shell --run 'cabal new-test --enable-tests' ||
    38:             fail "Cabal tests failed"
    39:         else
    40:           cabal new-test --enable-tests || fail "Cabal tests failed"
    41:         fi
    42:       '';
    43:     };
    44: };
    45: mapAttrs testRepo helpers.myHaskellRepos

Generated by git2html.