hnix/tests/Main.hs

30 lines
880 B
Haskell
Raw Normal View History

2014-08-03 14:17:43 +02:00
module Main where
2018-04-05 00:32:21 +02:00
import Control.Monad
2015-12-21 06:55:53 +01:00
import qualified EvalTests
2018-02-09 15:32:53 +01:00
import qualified NixLanguageTests
import qualified ParserTests
import qualified PrettyTests
import System.Environment
import System.Posix.Files
import Test.Tasty
2016-01-23 22:46:30 +01:00
2014-08-03 14:17:43 +02:00
main :: IO ()
2018-02-09 15:32:53 +01:00
main = do
nixLanguageTests <- NixLanguageTests.genTests
2018-04-05 00:32:21 +02:00
langTestsEnv <- lookupEnv "LANGUAGE_TESTS"
let runLangTests = langTestsEnv == Just "yes"
when runLangTests $ do
exist <- fileExist "data/nix/tests/local.mk"
2018-04-05 01:33:43 +02:00
unless exist $
errorWithoutStackTrace $ unlines
[ "Directory data/nix does not have any files."
, "Did you forget to run \"git submodule update --init --recursive\"?"
]
defaultMain $ testGroup "hnix" $
2018-02-09 15:32:53 +01:00
[ ParserTests.tests
, EvalTests.tests
, PrettyTests.tests
] ++
2018-04-05 00:32:21 +02:00
[ nixLanguageTests | runLangTests ]