remote: Put tests behind io-testsuite flag

Disabled by default since it requires `nix-daemon` binary
and Linux namespaces support.

For development this can be enabled by

```
cabal configure --flag=io-testsuite
```

or by adding

```
flags: +io-testsuite
```

to `cabal.project.local`

Enabled by `callCabal2nixWithOptions` in `overlay.nix` so
it is tested by `nix-build` and `nix-shell` brings all
test dependencies.

This is fine on NixOS where `build-tool-depends: nix:nix-daemon` works
and we have namespaces supported.
This commit is contained in:
Richard Marko 2020-07-14 13:20:04 +02:00
parent 850bafdb84
commit dff752750d
2 changed files with 13 additions and 1 deletions

View File

@ -13,6 +13,13 @@ build-type: Simple
extra-source-files: ChangeLog.md, README.md
cabal-version: >=1.10
flag io-testsuite
default:
False
description:
Enable testsuite, which requires external
binaries and Linux namespace support.
library
exposed-modules: System.Nix.Store.Remote
, System.Nix.Store.Remote.Binary
@ -45,6 +52,11 @@ library
ghc-options: -Wall
test-suite hnix-store-remote-tests
if !flag(io-testsuite)
buildable: False
build-tool-depends: nix:nix-daemon
ghc-options: -rtsopts -fprof-auto
type: exitcode-stdio-1.0
main-is: Driver.hs

View File

@ -2,5 +2,5 @@ huper: helf: {
hnix-store-core =
helf.callCabal2nix "hnix-store-core" ./hnix-store-core {};
hnix-store-remote =
helf.callCabal2nix "hnix-store-remote" ./hnix-store-remote {};
helf.callCabal2nixWithOptions "hnix-store-remote" ./hnix-store-remote "-fio-testsuite" {};
}