From 858403fc3ea0888ea748cb23b04fcefe1d21c117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 23 May 2026 12:37:36 +0200 Subject: Loaded modules data type to store related info --- src/Main.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index a77e8cc..9969109 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -194,11 +194,11 @@ main = do | otherwise = OutputStyleQuiet out <- startOutput outputStyle useColor - ( modules, tags, globalDefs ) <- loadModules (map fst files) + LoadedModules {..} <- loadModules (map fst files) - let excludedTests = optExclude opts ++ map (snd . fst) (filter (\( ( _, _ ), ts ) -> any (\(Tag _ t) -> textVarName t `elem` optExclude opts) ts) tags) + let excludedTests = optExclude opts ++ map (snd . fst) (filter (\( ( _, _ ), ts ) -> any (\(Tag _ t) -> textVarName t `elem` optExclude opts) ts) lmTags) tests <- filter ((`notElem` excludedTests) . testName) <$> if null otests - then fmap concat $ forM (zip modules files) $ \( Module {..}, ( filePath, mbTestName )) -> do + then fmap concat $ forM (zip lmModules files) $ \( Module {..}, ( filePath, mbTestName )) -> do case mbTestName of Nothing -> return moduleTests Just name @@ -209,7 +209,7 @@ main = do hPutStrLn stderr $ "Test ‘" <> T.unpack name <> "’ not found in ‘" <> filePath <> "’" exitFailure else forM otests $ \name -> if - | Just test <- find ((name ==) . testName) $ concatMap moduleTests modules + | Just test <- find ((name ==) . testName) $ concatMap moduleTests lmModules -> return test | otherwise -> do @@ -224,7 +224,7 @@ main = do let topts = (optTest opts) { optTcpdump = tcpdump } - ok <- allM (runTest out topts globalDefs) $ + ok <- allM (runTest out topts lmGlobalDefs) $ concat $ replicate (optRepeat opts) tests when (not ok) exitFailure -- cgit v1.2.3