From f0d9b96b62c975484d83f8972cd36f0c72e63706 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 17 Jan 2024 10:37:00 +0100 Subject: [PATCH 1/2] Whitespace. --- integration/Setup.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration/Setup.hs b/integration/Setup.hs index c04d77808a5..551ff71608b 100644 --- a/integration/Setup.hs +++ b/integration/Setup.hs @@ -94,6 +94,7 @@ collectTestsInModule pkgRoot fn = do where extractComment :: Comment -> String extractComment (Comment _ _ s) = s + testName :: Name (SrcSpanInfo, [Comment]) -> Maybe (String, String, String) testName name = let (n', comments) = @@ -105,7 +106,9 @@ collectTestsInModule pkgRoot fn = do let (summary, rest) = collectDescription comments in pure (n', summary, rest) else Nothing + absolutePath = pkgRoot fn + -- All of the haskell-src-exts supported extensions that we are using. -- Several that are in the cabal file couldn't be directly copied over, -- but they aren't causing trouble at the moment. From b2855801833f2c822203c8847a958db2ceb3fdc4 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 17 Jan 2024 10:38:13 +0100 Subject: [PATCH 2/2] Don't let /integration/Setup.hs collect temp files. (With patterns for emacs backup and auto-save files, but can easily be extended.) --- integration/Setup.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/integration/Setup.hs b/integration/Setup.hs index 551ff71608b..a9c6110e00b 100644 --- a/integration/Setup.hs +++ b/integration/Setup.hs @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wall #-} import Control.Applicative @@ -33,7 +34,16 @@ collectTests pkgRoot roots = findAllTests :: FilePath -> IO [(String, String, String, String)] findAllTests root = do paths <- findPaths root - concat <$> traverse (findModuleTests root) paths + concat <$> traverse (findModuleTests root) (filter (not . noise) paths) + + -- don't touch emacs auto-save or backup files + noise :: FilePath -> Bool + noise (last . splitDirectories -> fn) = autosave fn || backup fn + where + backup = (== '~') . last + autosave ('.' : '#' : _) = True + autosave ('#' : _) = True -- (if you want to make this pattern more strict: there is also a '#' at the end.) + autosave _ = False findModuleTests :: FilePath -> FilePath -> IO [(String, String, String, String)] findModuleTests root path = do