This directory contains a bunch of integration tests for Stack. Each
directory inside the tests subdirectory represents a single
test. Each of those directories has:
- A
Main.hsfile, which provides the script to be run - A
filesdirectory, providing the working directory the script will be run from. (If you have a test that doesn't require any specific working directory, there may be nofilesdirectory.)
It would be great to expand this file into a full tutorial, but for now, the easiest way to get started with writing an integration test is to copy an existing example.
One simple way to run a single test is:
- Change into the
filesdirectory - Run the command
stack runghc -- -i../../../lib ../Main.hs
A more thorough way to run the tests is with
$ stack test --flag stack:integration-tests stack:test:stack-integration-testNote that this command can take a long time. It's also more thorough
than the quick command given above, as it will run each test with a
clean STACK_ROOT.