ENH use bracket dbus for xmobar tests
This commit is contained in:
parent
3b8c6b0f4f
commit
8c20a4668d
|
@ -46,7 +46,7 @@ main = getArgs >>= parse
|
||||||
parse :: [String] -> IO ()
|
parse :: [String] -> IO ()
|
||||||
parse [] = run
|
parse [] = run
|
||||||
parse ["--deps"] = withCache printDeps
|
parse ["--deps"] = withCache printDeps
|
||||||
parse ["--test"] = void $ withCache . evalConfig =<< connectDBus
|
parse ["--test"] = withCache $ withDBus_ evalConfig
|
||||||
parse _ = usage
|
parse _ = usage
|
||||||
|
|
||||||
run :: IO ()
|
run :: IO ()
|
||||||
|
@ -66,11 +66,13 @@ evalConfig db = do
|
||||||
return $ config bf ifs ios cs d
|
return $ config bf ifs ios cs d
|
||||||
|
|
||||||
printDeps :: FIO ()
|
printDeps :: FIO ()
|
||||||
printDeps = do
|
printDeps = withDBus_ $ \db ->
|
||||||
db <- io connectDBus
|
mapM_ (liftIO . putStrLn . T.unpack) $
|
||||||
let ps = sort $ nub $ fmap showFulfillment $ concatMap dumpFeature $ allFeatures db
|
sort $
|
||||||
io $ mapM_ (putStrLn . T.unpack) ps
|
nub $
|
||||||
io $ disconnectDBus db
|
fmap showFulfillment $
|
||||||
|
concatMap dumpFeature $
|
||||||
|
allFeatures db
|
||||||
|
|
||||||
usage :: IO ()
|
usage :: IO ()
|
||||||
usage =
|
usage =
|
||||||
|
|
Loading…
Reference in New Issue