mirror of
https://github.com/swarm-game/swarm.git
synced 2024-08-16 18:10:23 +03:00
Isolate work directory for 'stack test' (#995)
Closes #936. With this change, `stack build` should be invoked as normal, but to run tests one should invoke the new script, which will place compilation artifacts in a separate directory so as to not stomp on the previous `stack build` artifacts. ## Demo ``` stack build ./scripts/run-tests.sh stack build ``` All perform incremental compilation rather than from-scratch.
This commit is contained in:
parent
f2fa93e33f
commit
68c992aa2d
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,6 +8,7 @@ cabal.project.local
|
||||
hie.yaml
|
||||
|
||||
.stack-work/
|
||||
.stack-work-test/
|
||||
stack.yaml.lock
|
||||
.hie/
|
||||
stan.html
|
||||
|
@ -203,6 +203,8 @@ check the `hie.yaml.stack` file. Pure Cabal should work fine with the defaults,
|
||||
but you might want to [add a GHC flag](https://haskell-language-server.readthedocs.io/en/latest/features.html)
|
||||
to build docs into `cabal.project.local`.
|
||||
|
||||
**TIP:** To run tests, you can use the [`scripts/run-tests.sh` script](scripts/run-tests.sh) to avoid problems with incremental compilation in alternation with `stack build`.
|
||||
|
||||
### Conventions
|
||||
|
||||
We follow a few conventions to help keep everyone on the same page.
|
||||
|
7
scripts/run-tests.sh
Executable file
7
scripts/run-tests.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
# See https://github.com/swarm-game/swarm/issues/936
|
||||
STACK_WORK=.stack-work-test stack test $@
|
Loading…
Reference in New Issue
Block a user