mirror of
https://github.com/nmattia/niv.git
synced 2024-09-05 20:15:26 +03:00
Move tests to exe
This commit is contained in:
parent
558e917f9c
commit
64e80a0cac
11
app/Niv.hs
11
app/Niv.hs
@ -7,7 +7,7 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
|
||||
module Niv where
|
||||
module Main where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Monad
|
||||
@ -18,7 +18,6 @@ import Data.Hashable (Hashable)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.String.QQ (s)
|
||||
import Niv.GitHub
|
||||
import Niv.Test
|
||||
import Niv.Update
|
||||
import System.Exit (exitFailure)
|
||||
import System.FilePath ((</>), takeDirectory)
|
||||
@ -36,7 +35,6 @@ import qualified GitHub as GH
|
||||
import qualified Options.Applicative as Opts
|
||||
import qualified Options.Applicative.Help.Pretty as Opts
|
||||
import qualified System.Directory as Dir
|
||||
import qualified Test.Tasty as Tasty
|
||||
|
||||
main :: IO ()
|
||||
main = join $ Opts.execParser opts
|
||||
@ -153,13 +151,6 @@ parsePackageSpec =
|
||||
parsePackage :: Opts.Parser (PackageName, PackageSpec)
|
||||
parsePackage = (,) <$> parsePackageName <*> parsePackageSpec
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- PACKAGE SPEC OPS
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
test :: IO ()
|
||||
test = Tasty.defaultMain $ Niv.Test.tests
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- INIT
|
||||
-------------------------------------------------------------------------------
|
||||
|
8
app/test.hs
Normal file
8
app/test.hs
Normal file
@ -0,0 +1,8 @@
|
||||
module Main where
|
||||
|
||||
import Niv.Test
|
||||
import qualified Test.Tasty as Tasty
|
||||
|
||||
main :: IO ()
|
||||
main = Tasty.defaultMain $ Niv.Test.tests
|
||||
|
@ -50,6 +50,9 @@ rec
|
||||
|
||||
tests = pkgs.callPackage ./tests { inherit niv; };
|
||||
|
||||
niv-test = pkgs.runCommand "niv-test" { buildInputs = [ niv ] ; }
|
||||
"niv-test && touch $out";
|
||||
|
||||
readme = pkgs.writeText "README.md"
|
||||
(with
|
||||
{ template = builtins.readFile ./README.tpl.md;
|
||||
|
10
package.yaml
10
package.yaml
@ -27,9 +27,7 @@ library:
|
||||
|
||||
executables:
|
||||
niv:
|
||||
source-dirs:
|
||||
- app
|
||||
main: Niv.main
|
||||
main: app/niv.hs
|
||||
data-files:
|
||||
- nix/sources.nix
|
||||
dependencies:
|
||||
@ -45,5 +43,9 @@ executables:
|
||||
- optparse-applicative
|
||||
- process
|
||||
- string-qq
|
||||
- tasty
|
||||
- unordered-containers
|
||||
niv-test:
|
||||
main: app/test.hs
|
||||
dependencies:
|
||||
- tasty
|
||||
- niv
|
||||
|
Loading…
Reference in New Issue
Block a user