web: run unit tests at startup.. it's handy for development, and why not

This commit is contained in:
Simon Michael 2011-06-13 21:44:38 +00:00
parent 95f461fc94
commit 2bdeb2bf6e

View File

@ -23,6 +23,7 @@ import Text.Printf
import Yesod.Helpers.Static import Yesod.Helpers.Static
import Hledger.Cli import Hledger.Cli
import Hledger.Cli.Tests (runTestsOrExit)
import Hledger.Data import Hledger.Data
import Prelude hiding (putStr, putStrLn) import Prelude hiding (putStr, putStrLn)
import Hledger.Utils.UTF8 (putStr, putStrLn) import Hledger.Utils.UTF8 (putStr, putStrLn)
@ -67,6 +68,8 @@ main = do
-- | The web command. -- | The web command.
web :: [Opt] -> [String] -> Journal -> IO () web :: [Opt] -> [String] -> Journal -> IO ()
web opts args j = do web opts args j = do
putStrLn $ "Running self-tests..."
runTestsOrExit opts args
created <- createFilesIfMissing created <- createFilesIfMissing
if created if created
then do then do