test: drop verbose test runner and testpack dependency
This commit is contained in:
parent
3865759bbd
commit
927948a644
@ -87,7 +87,7 @@ options = [
|
|||||||
#endif
|
#endif
|
||||||
,Option "h" ["help"] (NoArg Help) "show this help"
|
,Option "h" ["help"] (NoArg Help) "show this help"
|
||||||
,Option "V" ["version"] (NoArg Version) "show version information"
|
,Option "V" ["version"] (NoArg Version) "show version information"
|
||||||
,Option "v" ["verbose"] (NoArg Verbose) "show verbose test output"
|
,Option "v" ["verbose"] (NoArg Verbose) "show more verbose output"
|
||||||
,Option "" ["binary-filename"] (NoArg BinaryFilename) "show the download filename for this hledger build"
|
,Option "" ["binary-filename"] (NoArg BinaryFilename) "show the download filename for this hledger build"
|
||||||
,Option "" ["debug"] (NoArg Debug) "show extra debug output; implies verbose"
|
,Option "" ["debug"] (NoArg Debug) "show extra debug output; implies verbose"
|
||||||
,Option "" ["debug-vty"] (NoArg DebugVty) "run vty command with no vty output, showing console"
|
,Option "" ["debug-vty"] (NoArg DebugVty) "run vty command with no vty output, showing console"
|
||||||
|
|||||||
@ -29,7 +29,6 @@ $ hledger -f sample.ledger balance o
|
|||||||
module Hledger.Cli.Tests
|
module Hledger.Cli.Tests
|
||||||
where
|
where
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import Test.HUnit.Tools (runVerboseTests)
|
|
||||||
import System.Exit (exitFailure, exitWith, ExitCode(ExitSuccess)) -- base 3 compatible
|
import System.Exit (exitFailure, exitWith, ExitCode(ExitSuccess)) -- base 3 compatible
|
||||||
import System.Time (ClockTime(TOD))
|
import System.Time (ClockTime(TOD))
|
||||||
|
|
||||||
@ -45,13 +44,11 @@ import Hledger.Cli.Utils
|
|||||||
-- | Run unit tests.
|
-- | Run unit tests.
|
||||||
runtests :: [Opt] -> [String] -> IO ()
|
runtests :: [Opt] -> [String] -> IO ()
|
||||||
runtests _ args = do
|
runtests _ args = do
|
||||||
(counts,_) <- runner ts
|
(counts,_) <- liftM (flip (,) 0) $ runTestTT ts
|
||||||
if errors counts > 0 || (failures counts > 0)
|
if errors counts > 0 || (failures counts > 0)
|
||||||
then exitFailure
|
then exitFailure
|
||||||
else exitWith ExitSuccess
|
else exitWith ExitSuccess
|
||||||
where
|
where
|
||||||
runner | Verbose `elem` opts = runVerboseTests
|
|
||||||
| otherwise = liftM (flip (,) 0) . runTestTT
|
|
||||||
ts = TestList $ filter matchname $ tflatten tests -- show flat test names
|
ts = TestList $ filter matchname $ tflatten tests -- show flat test names
|
||||||
-- ts = tfilter matchname $ TestList tests -- show hierarchical test names
|
-- ts = tfilter matchname $ TestList tests -- show hierarchical test names
|
||||||
matchname = matchpats args . tname
|
matchname = matchpats args . tname
|
||||||
|
|||||||
@ -233,7 +233,7 @@ Here is the command-line help:
|
|||||||
--port web: serve on tcp port N (default 5000)
|
--port web: serve on tcp port N (default 5000)
|
||||||
-h --help show this help
|
-h --help show this help
|
||||||
-V --version show version information
|
-V --version show version information
|
||||||
-v --verbose show verbose test output
|
-v --verbose show more verbose output
|
||||||
--binary-filename show the download filename for this hledger build
|
--binary-filename show the download filename for this hledger build
|
||||||
--debug show extra debug output; implies verbose
|
--debug show extra debug output; implies verbose
|
||||||
--debug-vty run vty command with no vty output, showing console
|
--debug-vty run vty command with no vty output, showing console
|
||||||
|
|||||||
@ -84,7 +84,6 @@ executable hledger
|
|||||||
,process
|
,process
|
||||||
,regexpr >= 0.5.1
|
,regexpr >= 0.5.1
|
||||||
,safe >= 0.2
|
,safe >= 0.2
|
||||||
,testpack >= 1 && < 2
|
|
||||||
,time
|
,time
|
||||||
,utf8-string >= 0.3
|
,utf8-string >= 0.3
|
||||||
|
|
||||||
@ -162,7 +161,6 @@ library
|
|||||||
,process
|
,process
|
||||||
,regexpr >= 0.5.1
|
,regexpr >= 0.5.1
|
||||||
,safe >= 0.2
|
,safe >= 0.2
|
||||||
,testpack >= 1 && < 2
|
|
||||||
,time
|
,time
|
||||||
,utf8-string >= 0.3
|
,utf8-string >= 0.3
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user