Two new libraries to extend tasty testing framework
When I recently wrote about porting my haskell-testing-stub project to tasty I mentioned that test-framework still has more libraries than tasty. I decided to contribute to changing that and released two small packages that extend tasty with extra functionality:
tasty-hunit-adapter
allows to import existing HUnit tests into tasty (hackage, github):module Main where import Test.HUnit ( (~:), (@=?) ) import Test.Tasty ( defaultMain, testGroup ) import Test.Tasty.HUnit.Adapter ( hUnitTestToTestTree ) main :: IO () = defaultMain $ testGroup "Migrated from HUnit" $ main "HUnit test" ~: 2 + 2 @=? 4) hUnitTestToTestTree (
tasty-program
allows to run external program and test whether it terminates successfully (hackage, github):module Main ( mainwhere ) import Test.Tasty import Test.Tasty.Program main :: IO () = defaultMain $ testGroup "Compilation with GHC" $ [ main "Foo" "ghc" ["-fforce-recomp", "foo.hs"] testProgram Nothing ]
This package has only this basic functionality at the moment. A missing feature is the possibility of logging stdout and stderr to a file so that it can later be inspected or perhaps used by a golden test (but for the latter tasty needs test dependencies).