module Main where
import System.Environment (getArgs, withArgs)
import Test.MuCheck (mucheck)
import Test.MuCheck.TestAdapter.Hspec
import Test.MuCheck.TestAdapter
import Test.MuCheck.Utils.Print
main :: IO ()
main = do
val <- getArgs
case val of
("-h" : _ ) -> help
(fn : file : args) -> withArgs [] $ mucheck tsFn fn file args
_ -> error "Need function file [args]\n\tUse -h to get help"
where tsFn :: [Mutant] -> [InterpreterOutput HspecSummary] -> Summary
tsFn = testSummary
help :: IO ()
help = putStrLn $ "mucheck function file [args]\n" ++ showAS ["E.g:",
" mucheck-hspec qsort Examples/HspecTest.hs spec"]