File tree Expand file tree Collapse file tree
test/integration/tests/4001-excess-recompilation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import Control.Monad (unless )
2+ import Data.List (isInfixOf )
3+ import StackTest
4+
5+ main :: IO ()
6+ main = do
7+ copy " test/Main1.hs" " test/Main.hs"
8+ copy " bench/Main1.hs" " bench/Main.hs"
9+ stack [" build" ]
10+
11+ copy " test/Main2.hs" " test/Main.hs"
12+ copy " bench/Main2.hs" " bench/Main.hs"
13+ res <- unregisteringLines . snd <$> stackStderr [" build" ]
14+ removeFileIgnore " test/Main.hs"
15+ removeFileIgnore " bench/Main.hs"
16+ unless (null res) $ fail " Stack recompiled when a test or benchmark file was changed, but only the library was targeted"
17+
18+ unregisteringLines :: String -> [String ]
19+ unregisteringLines = filter (isInfixOf " unregistering " ) . lines
Original file line number Diff line number Diff line change 1+ import Distribution.Simple
2+ main = defaultMain
Original file line number Diff line number Diff line change 1+ import Lib
2+
3+ main :: IO ()
4+ main = putStrLn " I am Main1"
5+
Original file line number Diff line number Diff line change 1+ import Lib
2+
3+ main :: IO ()
4+ main = putStrLn " I am Main2"
5+
Original file line number Diff line number Diff line change 1+ name : files
2+ version : 0.1.0.0
3+ build-type : Simple
4+ cabal-version : >= 2.0
5+
6+ library
7+ hs-source-dirs : src
8+ exposed-modules : Lib
9+ build-depends : base
10+ default-language : Haskell2010
11+
12+ test-suite test
13+ hs-source-dirs : test
14+ main-is : Main.hs
15+ build-depends : base, files
16+ default-language : Haskell2010
17+ type : exitcode-stdio-1.0
18+
19+ benchmark bench
20+ hs-source-dirs : bench
21+ main-is : Main.hs
22+ build-depends : base, files
23+ default-language : Haskell2010
24+ type : exitcode-stdio-1.0
25+
Original file line number Diff line number Diff line change 1+ module Lib where
2+
Original file line number Diff line number Diff line change 1+ resolver : ghc-8.2.2
Original file line number Diff line number Diff line change 1+ import Lib
2+
3+ main :: IO ()
4+ main = putStrLn " I am Main1"
5+
Original file line number Diff line number Diff line change 1+ import Lib
2+
3+ main :: IO ()
4+ main = putStrLn " I am Main2"
5+
You can’t perform that action at this time.
0 commit comments