packages feed

hunit-gui 0.1.2 → 0.1.3

raw patch · 8 files changed

+71/−26 lines, 8 files

Files

Test/HUnit/Gui/Runner.hs view
@@ -14,7 +14,7 @@   return counts'     where       reportStart state _ = do-        updateTestsRun $ show $ counts state+        updateTestsRun $ show $ describePath $ path state         updateTestBar $ counts state         return GuiUpdater       reportErrors msg state _ = reportErrorsFailures (describeError msg state) state
+ examples/AllTestsPass.hs view
@@ -0,0 +1,16 @@+module AllTestsPass+where++import Test.HUnit+import Test.HUnit.Gui++import Util.FakeTests++main = do+  testInfo <- runTestGui bigLongTests+  exitWhenGuiCloses testInfo++bigLongTests :: Test+bigLongTests = test [ "long-running" ~: fakeSuccess 2000+                    , "short-running" ~: fakeSuccess 500+                    ]
− examples/Main.hs
@@ -1,23 +0,0 @@-module Main-where--import Control.Concurrent--import Test.HUnit-import Test.HUnit.Gui--main = do-  testInfo <- runTestGui bigLongTests-  exitWhenGuiCloses testInfo--bigLongTests :: Test-bigLongTests = test [ "long-running success" ~: fakeTest True 2000-                    , "quick-running success" ~: fakeTest True 500-                    , "long-running failure" ~: fakeTest False 2000-                    , "quick-running failure" ~: fakeTest False 500-                    ]--fakeTest :: Bool -> Int -> IO ()-fakeTest success milliseconds = do-  threadDelay $ milliseconds * 1000-  assertBool "No msg" success
+ examples/README.txt view
@@ -0,0 +1,3 @@+These Haskell files are test suites that show off the different features of the HUnit GUI.  They assume basic familiarity with HUnit.++To compile them, run build.sh.  The executables will be in examples/bin/ .  You can also run "ghc --make [filename]" on them individually.  When run, the GUI window may appear below other windows on your screen.
+ examples/SomeTestsFail.hs view
@@ -0,0 +1,18 @@+module SomeTestsFail+where++import Test.HUnit+import Test.HUnit.Gui++import Util.FakeTests++main = do+  testInfo <- runTestGui bigLongTests+  exitWhenGuiCloses testInfo++bigLongTests :: Test+bigLongTests = test [ "long-running success" ~: fakeSuccess 2000+                    , "quick-running success" ~: fakeSuccess 500+                    , "long-running failure" ~: fakeFailure 2000+                    , "quick-running failure" ~: fakeFailure 500+                    ]
+ examples/Util/FakeTests.hs view
@@ -0,0 +1,16 @@+module Util.FakeTests (fakeSuccess, fakeFailure)+where++import Control.Concurrent+import Test.HUnit++fakeTest :: Bool -> Int -> IO ()+fakeTest success milliseconds = do+  threadDelay $ milliseconds * 1000+  assertBool "this is an assert message" success++fakeSuccess :: Int -> IO ()+fakeSuccess = fakeTest True++fakeFailure :: Int -> IO ()+fakeFailure = fakeTest False
+ examples/build.sh view
@@ -0,0 +1,9 @@+#!/usr/bin/env bash++mkdir -p bin/++for F in *.hs+do+  MODULE_NAME=${F/.hs/}+  ghc -i.. -odir bin/ -hidir bin/ -main-is $MODULE_NAME -o bin/$MODULE_NAME --make $F+done
hunit-gui.cabal view
@@ -1,5 +1,5 @@ Name:           hunit-gui-Version:        0.1.2+Version:        0.1.3 Cabal-Version:  >= 1.6 License:        PublicDomain Author:         Kim Wallmark@@ -7,12 +7,18 @@ Category:       Testing Synopsis:       A GUI testrunner for HUnit Build-Type:     Custom-Data-Files:     examples/Main.hs Maintainer:	kim_hunitgui@arlim.org Description:     hunit-gui is a graphical front-end for HUnit.  It provides a test     controller you can use in place of runTestTT or runTestText, as well     as an optional cleanup step.++Data-Files:+  examples/README.txt+  examples/build.sh+  examples/AllTestsPass.hs+  examples/SomeTestsFail.hs+  examples/Util/FakeTests.hs  Library   Exposed-modules: