on cbb57f2 help sign in
streamly/test/README.md
97 lines 1.8 kB history raw
1## Using bin/test.sh
3`bin/test.sh` (path relative to the top level repo dir) can run selected
4test groups, generate coverage report, pass GHC RTS options when
5running tests. `test.sh` runs the tests with restricted memory, see
6`bin/test.sh` source for details on the amount of memory used or to change it.
8To generate coverage report:
10```
11$ bin/test.sh --coverage
12```
14To view coverage report, open `./hpc_index.html` in browser.
16See `bin/test.sh --help` for more info.
18## Build a single test
20```
21$ cabal build test:Prelude.Serial
22```
24or:
26```
27$ cd test; cabal build Prelude.Serial
28```
30Build with optimizations:
32```
33$ cabal build --flag opt ...
34```
36## Build all tests
38```
39$ cabal build --enable-tests all
40```
42or:
44```
45$ cd test; cabal build --enable-tests
46```
48Or this, note this command does not work as expected when in the "test" dir:
50```
51$ cabal build --enable-tests streamly-tests
52```
54## Build and run
56Running all test suites, use any of the following:
58```
59$ cabal test all
60```
62or:
64```
65$ cd test; cabal test
66```
68Or this, note this command does not work as expected when in the "test" dir:
70```
71$ cabal test streamly-tests
72```
74## Build and Run a single test suite
76To run `Prelude.Serial` test-suite:
78```
79$ cabal run test:Prelude.Serial
80```
82or:
84```
85$ cd test; cabal run Prelude.Serial
86```
88Note you could use `cabal test Prelude.Serial` but that unfortunately builds
89all the test suites before running `Prelude.Serial`.
91## Naming of test modules
93Tests are organized by source modules. For example, for the source
94module `Streamly.Data.Array` and `Streamly.Internal.Data.Array` we have
95a test module `Data.Array`. For some modules tests for a source module
96are broken into multiple modules. For example, for `Streamly.Prelude` we have
97`Streamly.Prelude.Serial`, `Streamly.Prelude.Async` etc.