From 73bc81cd7ed8227b3aeb258a60fd04ff579848ec Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 25 Nov 2009 11:30:50 +0000 Subject: [PATCH] add missing test runner --- tools/unittest.hs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tools/unittest.hs diff --git a/tools/unittest.hs b/tools/unittest.hs new file mode 100644 index 000000000..6df6c30b0 --- /dev/null +++ b/tools/unittest.hs @@ -0,0 +1,24 @@ +{- +A standalone unit test runner using test-framework. Compared to hledger's +built-in test runner, this one shows verbose ansi-colored hierarchic +results, can run tests in parallel, and may have better quickcheck support. +-} + +import Test.Framework (defaultMain {-, testGroup-}) +import Test.Framework.Providers.HUnit (hUnitTestToTests) +--import Test.Framework.Providers.QuickCheck2 (testProperty) +import Test.HUnit hiding (Test) +import qualified Test.HUnit (Test) +--import Test.QuickCheck +import Tests (tests) +import System.Exit (-- exitFailure, exitWith, + ExitCode(..)) +import System.IO (hGetContents, hPutStr, hFlush, stderr, stdout) +import Text.Printf (printf) +--import Text.ParserCombinators.Parsec +import Control.Monad (liftM,when) +import Data.Maybe (fromMaybe) +import System.Process (runInteractiveCommand, waitForProcess) + +main :: IO () +main = defaultMain $ concatMap hUnitTestToTests tests