gRPC-haskell/tests/tests.patch
Gabriel Gonzalez c02546f696 Fix grpc-haskell tests for Nix (#80)
This updates the `release.nix` to now correctly run the test suite.  You can
now build and test `grpc-haskell` by running:

```
$ nix-build -A grpc-haskell release.nix
```

... and `nix-shell` has been updated, too, so that you can do `cabal`
development inside of a `nix-shell` by running:

```
$ nix-shell -A grpc-haskell.env release.nix
```

For people who prefer to use `stack` you can still just build the `grpc`
library by running:

```
$ nix-build -A grpc release.nix
```

... then pass that library as input to `stack`
2016-12-12 10:40:23 -08:00

43 lines
1.2 KiB
Diff

diff --git a/tests/simple-client.sh b/tests/simple-client.sh
index 8feb1f4..ca925b1 100755
--- a/tests/simple-client.sh
+++ b/tests/simple-client.sh
@@ -2,7 +2,7 @@
hsTmpDir=$1
-stack ghc -- \
+ghc \
--make \
-threaded \
-odir $hsTmpDir \
@@ -11,3 +11,7 @@ stack ghc -- \
$hsTmpDir/Simple.hs \
tests/TestClient.hs \
> /dev/null
+
+. @makeWrapper@/nix-support/setup-hook
+
+flagsBefore="" wrapProgram "${hsTmpDir}/simple-client" --prefix DYLD_LIBRARY_PATH : @grpc@/lib
diff --git a/tests/simple-server.sh b/tests/simple-server.sh
index 37a0a63..eb37776 100755
--- a/tests/simple-server.sh
+++ b/tests/simple-server.sh
@@ -2,7 +2,7 @@
hsTmpDir=$1
-stack ghc -- \
+ghc \
--make \
-threaded \
-odir $hsTmpDir \
@@ -11,3 +11,7 @@ stack ghc -- \
$hsTmpDir/Simple.hs \
tests/TestServer.hs \
> /dev/null
+
+. @makeWrapper@/nix-support/setup-hook
+
+flagsBefore="" wrapProgram "${hsTmpDir}/simple-server" --prefix DYLD_LIBRARY_PATH : @grpc@/lib