Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: doctests: add --verbose and --slow flags to executable
--slow turns off doctest's --fast flag, which skips reloading between tests. --verbose shows progress output as tests are run, if doctest 0.16.0+ is installed (and I believe will be harmless otherwise)
- Loading branch information
1 parent
8a4fb59
commit ed93807
Showing
2 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
{-# LANGUAGE PackageImports #-} | ||
|
||
import Data.List | ||
import System.Environment | ||
import "Glob" System.FilePath.Glob | ||
import Test.DocTest | ||
|
||
main = do | ||
args <- getArgs | ||
fs1 <- glob "Hledger/**/*.hs" | ||
fs2 <- glob "Text/**/*.hs" | ||
--fs3 <- glob "other/ledger-parse/**/*.hs" | ||
let fs = filter (not . isInfixOf "/.") $ ["Hledger.hs"] ++ fs1 ++ fs2 | ||
doctest $ | ||
"--fast" : -- https://github.com/sol/doctest#a-note-on-performance | ||
-- show verbose progress output | ||
(if "--verbose" `elem` args then ("--verbose" :) else id) $ | ||
-- don't reload environment per test (opposite of doctest's --fast, | ||
-- https://github.com/sol/doctest#a-note-on-performance) | ||
(if "--slow" `elem` args then id else ("--fast" :)) $ | ||
fs |