diff --git a/ormolu.cabal b/ormolu.cabal index 988aca13a..a28c72726 100644 --- a/ormolu.cabal +++ b/ormolu.cabal @@ -156,10 +156,11 @@ executable ormolu test-suite tests type: exitcode-stdio-1.0 - main-is: Spec.hs + main-is: Main.hs build-tool-depends: hspec-discover:hspec-discover >=2 && <3 hs-source-dirs: tests other-modules: + Spec Ormolu.CabalInfoSpec Ormolu.Diff.TextSpec Ormolu.Fixity.ParserSpec diff --git a/tests/Main.hs b/tests/Main.hs new file mode 100644 index 000000000..e6205337a --- /dev/null +++ b/tests/Main.hs @@ -0,0 +1,11 @@ +module Main where + +import Ormolu.Config qualified as Ormolu +import Ormolu.Logging (initializeLogging) +import Spec qualified +import Test.Hspec.Runner + +main :: IO () +main = do + initializeLogging Ormolu.defaultConfig + hspec Spec.spec diff --git a/tests/Spec.hs b/tests/Spec.hs index a824f8c30..5416ef6a8 100644 --- a/tests/Spec.hs +++ b/tests/Spec.hs @@ -1 +1 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover #-} +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} diff --git a/weeder.toml b/weeder.toml index 9a2c8b639..81155607b 100644 --- a/weeder.toml +++ b/weeder.toml @@ -1,6 +1,7 @@ roots = [ "^Main.main$", "^Paths_", + "^Spec.main$", "^Ormolu.Terminal.QualifiedDo.>>$" # https://github.com/ocharles/weeder/issues/112 ] type-class-roots = true