Skip to content

Commit

Permalink
Merge pull request #290 from mbj/add/devtools-test-subcommand-parser
Browse files Browse the repository at this point in the history
[devtools] Add test subcommand parser
  • Loading branch information
mbj authored Nov 25, 2023
2 parents 412bb1a + 814bda1 commit c62ed6f
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 7 deletions.
2 changes: 2 additions & 0 deletions aws-rds/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -126,6 +127,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
1 change: 1 addition & 0 deletions aws-rds/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions bounded/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -129,6 +130,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
1 change: 1 addition & 0 deletions bounded/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions cli-utils/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -109,6 +110,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions cli-utils/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.3.0
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 6.0.0.1
Expand Down Expand Up @@ -102,6 +103,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions conversions/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -124,6 +125,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
1 change: 1 addition & 0 deletions conversions/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
4 changes: 4 additions & 0 deletions devtools/devtools.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ library
, filepath >=1.4
, hlint >=3.5
, mprelude
, optparse-applicative
, tasty >=1.3.1
, tasty-mgolden >=0.0.1
, template-haskell
, text
, th-lift
, typed-process >=0.2
, unliftio
default-language: Haskell2010
if flag(development)
ghc-options: -Werror
Expand Down Expand Up @@ -99,12 +101,14 @@ test-suite test
, filepath >=1.4
, hlint >=3.5
, mprelude
, optparse-applicative
, tasty >=1.3.1
, tasty-mgolden >=0.0.1
, template-haskell
, text
, th-lift
, typed-process >=0.2
, unliftio
default-language: Haskell2010
if flag(development)
ghc-options: -Werror
Expand Down
16 changes: 9 additions & 7 deletions devtools/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ description: |
<<: *defaults

dependencies:
- Diff >= 0.4
- Diff >= 0.4
- base
- bytestring
- cmdargs >= 0.10.20
- filepath >= 1.4
- hlint >= 3.5
- cmdargs >= 0.10.20
- filepath >= 1.4
- hlint >= 3.5
- mprelude
- tasty >= 1.3.1
- tasty-mgolden >= 0.0.1
- optparse-applicative
- tasty >= 1.3.1
- tasty-mgolden >= 0.0.1
- template-haskell
- text
- th-lift
- typed-process >= 0.2
- typed-process >= 0.2
- unliftio

extra-doc-files:
- README.md
Expand Down
11 changes: 11 additions & 0 deletions devtools/src/Devtools.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{-# LANGUAGE ApplicativeDo #-}

module Devtools
( Devtools.Target(..)
, cliParser
, main
, readDependencies
, testTree
Expand All @@ -14,7 +17,10 @@ import qualified Devtools.HLint as HLint
import qualified Language.Haskell.TH as TH
import qualified Language.Haskell.TH.Lift as TH
import qualified Language.Haskell.TH.Syntax as TH
import qualified Options.Applicative as CLI
import qualified System.Exit as System
import qualified Test.Tasty as Tasty
import qualified UnliftIO.Environment as System

main :: Devtools.Dependencies -> IO ()
main dependencies = do
Expand All @@ -34,3 +40,8 @@ readDependencies
= TH.liftCode
. fmap TH.TExp
. (TH.lift <=< TH.runIO . Devtools.getDependencies)

cliParser :: MonadUnliftIO m => m Tasty.TestTree -> CLI.Parser (m System.ExitCode)
cliParser readTestTree = do
arguments <- CLI.many (CLI.strArgument $ CLI.metavar "ARGUMENT")
pure $ System.withArgs arguments ((liftIO . Tasty.defaultMain =<< readTestTree) $> System.ExitSuccess)
2 changes: 2 additions & 0 deletions devtools/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -108,6 +109,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions devtools/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.3.0
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 6.0.0.1
Expand Down Expand Up @@ -101,6 +102,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions mio-amazonka/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ regex-posix 0.96.0.1
resourcet 1.2.6
retry 0.9.3.1
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -169,6 +170,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions mio-amazonka/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ regex-posix 0.96.0.1
resourcet 1.3.0
retry 0.9.3.1
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 6.0.0.1
Expand Down Expand Up @@ -168,6 +169,7 @@ unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unix-time 0.4.11
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions mio-core/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -109,6 +110,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions mio-core/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.3.0
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 6.0.0.1
Expand Down Expand Up @@ -102,6 +103,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions mio-log/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -126,6 +127,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
1 change: 1 addition & 0 deletions mio-log/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
2 changes: 2 additions & 0 deletions openapi/test/stack-9.4-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ random 1.2.1.1
refact 0.3.0.2
resourcet 1.2.6
rts 1.0.2
safe-exceptions 0.1.7.4
scientific 0.3.7.0
semialign 1.3
semigroupoids 5.3.7
Expand Down Expand Up @@ -131,6 +132,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.7.3
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down
1 change: 1 addition & 0 deletions openapi/test/stack-9.6-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ typed-process 0.2.11.1
unbounded-delays 0.1.1.1
uniplate 1.6.13
unix 2.8.1.0
unliftio 0.2.25.0
unliftio-core 0.2.1.0
unordered-containers 0.2.19.1
utf8-string 1.0.2
Expand Down

0 comments on commit c62ed6f

Please sign in to comment.