Skip to content

Commit

Permalink
Initialize logging for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Sep 13, 2023
1 parent f4987d7 commit 9af9080
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ormolu.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.0 && <3.0
hs-source-dirs: tests
other-modules:
Spec
Ormolu.CabalInfoSpec
Ormolu.Diff.TextSpec
Ormolu.Fixity.ParserSpec
Expand Down
11 changes: 11 additions & 0 deletions tests/Main.hs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/Spec.hs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}
1 change: 1 addition & 0 deletions weeder.dhall
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ roots =
[ "^Main.main\$"
, "^Paths_"
, "^Spec.main\$"
, "^Ormolu.Terminal.QualifiedDo.>>\$" -- https://github.com/ocharles/weeder/issues/112
]
, type-class-roots = True
Expand Down

0 comments on commit 9af9080

Please sign in to comment.