Skip to content
Snippets Groups Projects
Commit a664325e authored by Iustin Pop's avatar Iustin Pop
Browse files

Reduce logging level in tests


This allows tests to execute IO actions which have logging as a side
effect, without polluting the stderr too much.

A better solution would be that we have fine-grained control over
loggers, so that tests can run with their own logging, etc. etc..

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 55438c07
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ module Main(main) where
import Data.Monoid (mappend)
import Test.Framework
import System.Environment (getArgs)
import System.Log.Logger
import Test.Ganeti.TestImports ()
import Test.Ganeti.Attoparsec
......@@ -120,4 +121,8 @@ main :: IO ()
main = do
ropts <- getArgs >>= interpretArgsOrExit
let opts = maybe defOpts (defOpts `mappend`) $ ropt_test_options ropts
-- silence the logging system, so that tests can execute I/O actions
-- which create logs without polluting stderr
-- FIXME: improve this by allowing tests to use logging if needed
updateGlobalLogger rootLoggerName (setLevel EMERGENCY)
defaultMainWithOpts allTests (ropts { ropt_test_options = Just opts })
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment