diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c7b7d5..d006000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,9 @@ jobs: - '9.4' - '9.6' - '9.8' + - '9.10' include: - - os: macos-latest + - os: macos-12 ghc: system steps: - uses: actions/checkout@v3 @@ -54,9 +55,6 @@ jobs: - shell: bash run: cabal update - - shell: bash - run: cabal configure --enable-tests --enable-benchmarks - - shell: bash run: cabal build all @@ -64,7 +62,7 @@ jobs: run: echo | cabal repl sensei --build-depends hspec-meta - shell: bash - run: cabal exec -- "${PWD}/$(find dist-newstyle/ -name spec -type f)" --times --print-slow + run: cabal exec -- $(cabal list-bin spec) --times --print-slow env: HSPEC_OPTIONS: --color diff --git a/cabal.project b/cabal.project index 10d1274..282723f 100644 --- a/cabal.project +++ b/cabal.project @@ -5,3 +5,8 @@ package sensei ghc-options: -Werror tests: True + +source-repository-package + type: git + location: https://github.com/sol/hinotify/ + tag: 2131698f86939542c7df2cf3e60b40cc7e42819c diff --git a/src/Trigger.hs b/src/Trigger.hs index 6e59250..e2da2ac 100644 --- a/src/Trigger.hs +++ b/src/Trigger.hs @@ -54,9 +54,12 @@ reloadedSuccessfully = any success . lines success :: String -> Bool success x = case stripPrefix "Ok, " x of Just "one module loaded." -> True + Just "one module reloaded." -> True Just "1 module loaded." -> True + Just "1 module reloaded." -> True Just xs | [_number, "modules", "loaded."] <- words xs -> True - Just xs -> "modules loaded: " `isPrefixOf` xs + Just xs | [_number, "modules", "reloaded."] <- words xs -> True + Just xs -> "modules loaded: " `isPrefixOf` xs || "modules reloaded: " `isPrefixOf` xs Nothing -> False removeProgress :: String -> String diff --git a/test/Helper.hs b/test/Helper.hs index 5aaa98d..5d1541d 100644 --- a/test/Helper.hs +++ b/test/Helper.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} module Helper ( module Imports , silent @@ -97,7 +98,7 @@ data Status = Ok | Failed deriving (Eq, Show) modulesLoaded :: Status -> [String] -> String -modulesLoaded status xs = show status ++ ", " ++ mods ++ " loaded." +modulesLoaded status xs = show status ++ ", " ++ mods ++ " " ++ loaded ++ "." where n = length xs mods @@ -109,3 +110,11 @@ modulesLoaded status xs = show status ++ ", " ++ mods ++ " loaded." | n == 5 = "five modules" | n == 6 = "six modules" | otherwise = show n ++ " modules" + +#if __GLASGOW_HASKELL__ < 910 + loaded = "loaded" +#else + loaded + | n == 0 = "to be reloaded" + | otherwise = "reloaded" +#endif diff --git a/test/TriggerSpec.hs b/test/TriggerSpec.hs index aa15619..022cbf8 100644 --- a/test/TriggerSpec.hs +++ b/test/TriggerSpec.hs @@ -193,11 +193,16 @@ spec = do writeFile name (passingSpec ++ "foo = bar") (trigger session >> trigger session) `shouldReturn` (Failure, [ "[1 of 1] Compiling Spec" +#if __GLASGOW_HASKELL__ < 910 , "" +#endif #if __GLASGOW_HASKELL__ >= 906 , "Spec.hs:9:7: error: [GHC-88464] Variable not in scope: bar" #else , "Spec.hs:9:7: error: Variable not in scope: bar" +#endif +#if __GLASGOW_HASKELL__ >= 910 + , "" #endif , modulesLoaded Failed [] , withColor Red "RELOADING FAILED"