cli: make cabal test suite run the test command, not just hunit tests

This commit is contained in:
Simon Michael 2018-08-18 14:36:02 +01:00
parent d778a92561
commit fa6f0e8d1a
2 changed files with 7 additions and 11 deletions

View File

@ -8,6 +8,7 @@ hledger's built-in commands, and helpers for printing the commands list.
module Hledger.Cli.Commands (
findCommand
,testcmd
,builtinCommands
,builtinCommandNames
,printCommandsList

View File

@ -1,13 +1,8 @@
import Hledger.Cli (tests_Hledger_Cli)
import System.Environment (getArgs)
import Test.Framework.Providers.HUnit (hUnitTestToTests)
import Test.Framework.Runners.Console (defaultMainWithArgs)
main :: IO ()
main = do
args <- getArgs
let args' = "--hide-successes" : args
defaultMainWithArgs (hUnitTestToTests tests_Hledger_Cli) args'
{-
Run hledger's (and hledger-lib's) unit tests as a cabal test suite,
by running the test command with no options.
-}
import Hledger.Cli
main = testcmd defcliopts (error "journal-less command tried to use the journal")