diff options
author | Agustín Martín Barbero <agusmbaterra@gmail.com> | 2019-07-19 18:23:18 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-07-19 09:23:18 -0700 |
commit | 145b4d5ad654a89f2dd9749b3b1774400373b792 (patch) | |
tree | 822b5adb663da649e1fdac0c9c86336b1af4332d | |
parent | 28cad165179378369fcf4d25656ea28357026baa (diff) | |
download | pandoc-145b4d5ad654a89f2dd9749b3b1774400373b792.tar.gz |
Improve CONTRIBUTING.md with information on tests (#5652)
from INSTALL.md and [elsewhere](https://github.com/jgm/pandoc/pull/4383#issuecomment-367379040)
-rw-r--r-- | CONTRIBUTING.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9db858814..6766b37e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -165,6 +165,35 @@ or, if you're using [stack], The test program is `test/test-pandoc.hs`. +To run particular tests (pattern-matching on their names), use +the `-p` option: + + cabal install pandoc --enable-tests + cabal test --test-options='-p markdown' + +Or with stack: + + stack test --test-arguments='-p markdown' + +It is often helpful to add `-j4` (run tests in parallel) +and `--hide-successes` (don't clutter output with successes) +to the test arguments as well. + +If you add a new feature to pandoc, please add tests as well, following +the pattern of the existing tests. The test suite code is in +`test/test-pandoc.hs`. If you are adding a new reader or writer, it is +probably easiest to add some data files to the `test` directory, and +modify `test/Tests/Old.hs`. Otherwise, it is better to modify the module +under the `test/Tests` hierarchy corresponding to the pandoc module you +are changing. + +For `docx` tests, you can rebuild the golden tests by passing `--accept` +to the test script (so if you're using stack, +`stack test --test-arguments "-p Docx --accept"`. Then just make sure to +commit the changed golden files in their own commit with a line that you +checked them in Word (mentioning Word version and OS), that they weren't +corrupted, and that they had the expected output. + Benchmarks ---------- |