haskell.nix/test
Hamish Mackenzie a443611ecf
Add evalSystem and evalPackages project args (#1546)
This adds a way to specify the `evalSystem` or `evalPackages` explicitly when calling the `project` functions.

Currently if we want to make a `flake` that supports multiple systems we have few options:

* Require builders for all the supported systems (even just for `nix flake show`).

* Pass `--impure` so that haskell.nix can see `builtins.currentSystem` to set up `pkgs.evalPackages` to use that.  Unfortunately this prevents nix from caching some of the work it does and often results in it recalculating for each supported system when it would otherwise be cached and take no time at all.

* Add an overlay to replace `evalPackages`.  This works, but it is not straight forward.

* Materialize the nix files for the project.

This change allows `evalSystem = "x86_64-linux";` to be passed telling `haskell.nix` to run `cabal` and `nix-tools` on that system.  The user will have to have a builder for that system, but does not need to have builders for the others (unless building outputs for them).
2022-07-28 20:03:05 +12:00
..
buildable Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
builder-haddock Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
c-ffi Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
ca-derivations Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
ca-derivations-include Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-22 Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-doctests Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-hpack Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-simple Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-simple-debug Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-simple-prof Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-source-repo Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-source-repo-comments Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
cabal-sublib Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
call-cabal-project-to-nix Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
call-stack-to-nix Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
coverage Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
coverage-golden Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
coverage-no-libs Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
exe-dlls Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
exe-lib-dlls Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
exe-only Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
external-static-plugin Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
extra-hackage Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
fully-static Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
ghc-options Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
ghcjs-overlay Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
githash Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
haskell-language-server Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
index-state Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
project-flags Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
setup-deps Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
sha256map Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
shell-for Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
shell-for-setup-deps Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
snapshots Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
stack-local-resolver Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
stack-local-resolver-subdir Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
stack-remote-resolver Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
stack-simple Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
stack-source-repo Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
sublib-docs Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
th-dlls Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
with-packages Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
default.nix Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
README.md Add cross-compiled musl libc builds of tests (#157) 2019-07-02 18:25:40 +10:00
regen.nix Spelling, typo and whitespace fixes (#833) 2020-08-31 11:08:25 +12:00
tests.sh Supporting ca-derivations experimental feature (#1494) 2022-06-23 12:39:35 +12:00
unit.nix Add evalSystem and evalPackages project args (#1546) 2022-07-28 20:03:05 +12:00
util.nix tests: Add more tests for "all" component merging 2019-02-07 09:39:12 +08:00

Haskell infrastructure test cases

To build the test cases, run from the test directory:

nix-build --no-out-link default.nix

To run all tests (includes impure tests), use the script:

./tests.sh

Generated code

If you change the test Cabal files or need to regenerate the code with nix-tools, then see regen.nix. Run it like this:

$(nix-build --no-out-link regen.nix)