Max - I was thinking about how to drive my new shell tests with your framework. I have: data ShellTest = ShellTest { filename ∷ String ,command ∷ String ,stdin ∷ Maybe String ,stdoutExpected ∷ Maybe String ,stderrExpected ∷ Maybe String ,exitCodeExpected ∷ Maybe ExitCode } deriving (Show) parseShellTest ∷ FilePath → IO ShellTest runShellTest ∷ ShellTest → IO Bool I converted to hunit tests with shellTestToHUnitTest t = filename t ~: do {r ← runShellTest t; assertBool "" r} and tied test-framework into my test runner with main = do args ← getArgs let (opts,files) = partition ((=="-").take 1) args hunittests ← mapM (λf → parseShellTest f >>= (return ∘ shellTestToHUnitTest)) files withArgs opts $ defaultMain $ concatMap hUnitTestToTests hunittests With surprisingly little code and pain, the new runner runs my 14 shell tests, with colored output, in the same time as the old one - 3.5s on this macbook. But, I can now add -j8 and get the same results output in.. 0.13s. This quite surprised me, and now I want to say: thank you very much! :) Best, -Simon $ time tools/shelltest2 tests/*.test -j8 :tests/eliding-balance.test: [OK] :tests/missing-real-and-virtual-amt.test: [OK] :tests/null-accountname-component.test: [OK] :tests/parens-in-account-name.test: [OK] :tests/sample-balance-depth.test: [OK] :tests/sample-balance-o.test: [OK] :tests/sample-balance.test: [OK] :tests/unbalanced.test: [OK] :tests/unicode-account-matching.test: [OK] :tests/unicode-balance.test: [OK] :tests/unicode-description-matching.test: [OK] :tests/unicode-print.test: [OK] :tests/unicode-register.test: [OK] :tests/virtual.test: [OK] Test Cases Total Passed 14 14 Failed 0 0 Total 14 14 real 0m0.132s user 0m0.104s sys 0m0.104s
PS - not cabalised, not even committed, but here's my shell test runner for folks to play with: http://joyful.com/repos/hledger/tools/shelltest2.hs http://joyful.com/repos/hledger/tests/ - test examples
2009/6/28 Simon Michael
But, I can now add -j8 and get the same results output in.. 0.13s. This quite surprised me, and now I want to say: thank you very much! :)
Awesome! I'm really glad to hear you are having success with the package! For anyone else on the list who wants to take a look, the package home page is at http://batterseapower.github.com/test-framework/ Cheers, Max
participants (3)
-
Felipe Lessa -
Max Bolingbroke -
Simon Michael