MuCheck-HUnit 0.2.0.0 → 0.2.1.0
raw patch · 3 files changed
+16/−14 lines, 3 filesdep +MissingHdep ~MuCheckPVP ok
version bump matches the API change (PVP)
Dependencies added: MissingH
Dependency ranges changed: MuCheck
API changes (from Hackage documentation)
Files
- MuCheck-HUnit.cabal +6/−4
- src/Main.hs +5/−6
- src/Test/MuCheck/TestAdapter/HUnit.hs +5/−4
MuCheck-HUnit.cabal view
@@ -1,5 +1,5 @@ name: MuCheck-HUnit-version: 0.2.0.0+version: 0.2.1.0 synopsis: Automated Mutation Testing for HUnit tests description: This package contains the test adapter for HUnit tests to use it with MuCheck homepage: https://bitbucket.com/osu-testing/mucheck-hunit@@ -19,12 +19,13 @@ source-repository this type: git location: https://bitbucket.org/osu-testing/mucheck-hunit.git- tag: 0.2.0.0+ tag: 0.2.1.0 executable mucheck-hunit build-depends: base >=4 && <5, HUnit>=1.0,- MuCheck== 0.2.0.*+ MissingH >= 1.3,+ MuCheck== 0.2.1.* default-language: Haskell2010 hs-source-dirs: src main-is: Main.hs@@ -34,7 +35,8 @@ exposed-modules: Test.MuCheck.TestAdapter.HUnit build-depends: base >=4 && <5, HUnit>=1.0,- MuCheck==0.2.0.*+ MissingH >= 1.3,+ MuCheck==0.2.1.* default-language: Haskell2010 hs-source-dirs: src
src/Main.hs view
@@ -1,6 +1,5 @@ module Main where import System.Environment (getArgs, withArgs)-import Control.Monad (void) import Test.MuCheck (mucheck) import Test.MuCheck.TestAdapter.HUnit@@ -12,12 +11,12 @@ val <- getArgs case val of ("-h" : _ ) -> help- (fn : file : modulename : args) -> withArgs [] $ mucheck tsFn fn file modulename args- _ -> error "Need function file modulename [args]\n\tUse -h to get help"- where tsFn :: [MutantFilename] -> [InterpreterOutput HUnitSummary] -> Summary+ (fn : file : args) -> withArgs [] $ mucheck tsFn fn file args+ _ -> error "Need function file [args]\n\tUse -h to get help"+ where tsFn :: [Mutant] -> [InterpreterOutput HUnitSummary] -> Summary tsFn = testSummary help :: IO ()-help = putStrLn $ "mucheck function file modulename [args]\n" ++ showAS ["E.g:",- " mucheck-hunit qsort Examples/HUnitTest.hs Examples.HUnitTest 'runTestTT tests'", ""]+help = putStrLn $ "mucheck function file [args]\n" ++ showAS ["E.g:",+ " mucheck-hunit qsort Examples/HUnitTest.hs 'runTestTT tests'", ""]
src/Test/MuCheck/TestAdapter/HUnit.hs view
@@ -4,6 +4,7 @@ import qualified Test.HUnit as HUnit import Test.MuCheck.TestAdapter import Test.MuCheck.Utils.Print (showA, showAS)+import Data.Hash.MD5 (md5s, Str(..)) import Data.Typeable import Data.List((\\))@@ -15,15 +16,15 @@ -- | Summarizable instance of `HUnitSumary` instance Summarizable HUnitSummary where testSummary mutantFiles results = Summary logMsg- where (loadingErrorCases, executedCases) = partitionEithers results- loadingErrorFiles = mutantFiles \\ map fst executedCases+ where (errorCases, executedCases) = partitionEithers results+ errorFiles = map (\l -> ".mutants/" ++ (md5s $ Str l) ++ ".hs") mutantFiles \\ map fst executedCases successCases = filter (isSuccess . snd) executedCases failuresCases = filter (isFailure . snd) executedCases runningErrorCases = filter ((>0) . HUnit.errors . snd) executedCases \\ failuresCases failToFullyTryCases = filter ((\c -> HUnit.cases c > HUnit.tried c) . snd) executedCases logMsg = showAS ["Details:",- "Loading error files:",showA loadingErrorFiles,- "Loading error messages:",showA loadingErrorCases,+ "Loading error files:",showA errorFiles,+ "Loading error messages:",showA errorCases, "Successes:", showA successCases, "Failures:", showA failuresCases, "Error while running:", showA runningErrorCases,