module Main where
import System.Environment (getArgs)
import Test.MuCheck (mucheck)
import Test.MuCheck.TestAdapter.HUnit
import Test.MuCheck.TestAdapter
import Test.MuCheck.Utils.Print
main :: IO ()
main = do
val <- getArgs
case val of
("-h" : _ ) -> help
(fn : file : args) -> do (msum, _tsum) <- mucheck tsFn fn file args
putStrLn (show msum)
_ -> error "Need function file [args]\n\tUse -h to get help"
where tsFn :: Mutant -> TestStr -> InterpreterOutput HUnitSummary -> Summary
tsFn = testSummary
help :: IO ()
help = putStrLn $ "mucheck function file [args]\n" ++ showAS ["E.g:",
" mucheck-hunit qsort Examples/HUnitTest.hs 'runTestTT tests'", ""]