Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a function that tests whether a program can be run successfully. For example if you have 'foo.hs' source file:
module Foo where foo :: Int foo = 5
you can test whether GHC can compile it:
module Main ( main ) where import Test.Tasty import Test.Tasty.Program main :: IO () main = defaultMain $ testGroup "Compilation with GHC" $ [ testProgram "Foo" "ghc" ["-fforce-recomp", "foo.hs"] Nothing ]
Program's output and error streams are ignored.
Synopsis
- testProgram :: TestName -> String -> [String] -> Maybe FilePath -> TestTree
- newtype CatchStderr = CatchStderr Bool
Documentation
:: TestName | Test name |
-> String | Program name |
-> [String] | Program options |
-> Maybe FilePath | Optional working directory |
-> TestTree |
Create test that runs a program with given options. Test succeeds if program terminates successfully.
newtype CatchStderr Source #
Instances
Show CatchStderr Source # | |
Defined in Test.Tasty.Program showsPrec :: Int -> CatchStderr -> ShowS # show :: CatchStderr -> String # showList :: [CatchStderr] -> ShowS # | |
IsOption CatchStderr Source # | |
Defined in Test.Tasty.Program |