Skip to content

Commit b2fdaec

Browse files
committed
Add bare-bones test suite
We probably want to be more clever and replace the `--test` invocation with a `detailed-0.9` testsuite. We probably also should integrate the QuickCheck tests into the testsuite. That would take a deeper reorganization than I'm willing to commit to now, though, so I'll leave it for another day. Closes: ndmitchell#396
1 parent 2a789a9 commit b2fdaec

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

hlint.cabal

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ flag hsyaml
6262
manual: True
6363
description: Use HsYAML instead of yaml
6464

65-
library
65+
library hlint-lib
6666
default-language: Haskell2010
6767
build-depends:
6868
base == 4.*, process, filepath, directory, containers,
@@ -107,14 +107,15 @@ library
107107

108108
hs-source-dirs: src
109109
exposed-modules:
110+
HLint
111+
-- this doesn't seem used anywhere in its own right?
110112
Language.Haskell.HLint
111113
other-modules:
112114
Paths_hlint
113115
Apply
114116
CmdLine
115117
Extension
116118
Fixity
117-
HLint
118119
HsColour
119120
Idea
120121
Report
@@ -174,14 +175,18 @@ library
174175
Test.Util
175176
ghc-options: -Wunused-binds -Wunused-imports -Worphans -Wprepositive-qualified-module
176177

177-
178178
executable hlint
179179
default-language: Haskell2010
180-
build-depends: base, hlint
180+
build-depends: base, hlint-lib
181181
main-is: src/Main.hs
182182

183183
-- See https://github.com/ndmitchell/hlint/pull/1169 for benchmarks
184184
-- that indicate -A32 is a good idea
185185
ghc-options: -rtsopts -with-rtsopts=-A32m
186186
if flag(threaded)
187187
ghc-options: -threaded
188+
189+
test-suite test-hlint
190+
type: exitcode-stdio-1.0
191+
main-is: tests/Main.hs
192+
build-depends: base, hlint-lib

misc/HLint_NoDataFiles.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- Running this script should report two errors
55

66
import Data.List
7-
import Language.Haskell.HLint
7+
import HLint
88
import Language.Haskell.TH.Syntax
99
import Network.HTTP
1010

src/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
module Main(main) where
33

4-
import Language.Haskell.HLint
4+
import HLint
55
import Control.Monad
66
import System.Environment
77
import System.Exit

tests/Main.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Main where
2+
3+
import HLint (hlint)
4+
5+
main = hlint ["--test"]

0 commit comments

Comments
 (0)