[Removed TestLibraryWhenCompiling. Nils Anders Danielsson **20100602160233 Ignore-this: 8e0c0b379544f1ad5bc4614712ac2ba7 ] { hunk ./Test/ChasingBottoms.hs 29 - -{- - --- If this module is imported the library refuses to be built whenever --- the tests fail. Doing this adds a dependency on Template Haskell, --- though, and the compilation takes considerably longer, plus some --- (intended) warnings are emitted. Furthermore, if some test should --- fail, then the emitted error message is rather unreadable. - -import Test.ChasingBottoms.TestLibraryWhenCompiling - --} hunk ./Test/ChasingBottoms/TestLibraryWhenCompiling.hs 1 -{-# OPTIONS -fth #-} - --- | By importing this module in e.g. "Test.ChasingBottoms" the --- library refuses to be built if the tests fail. - -module Test.ChasingBottoms.TestLibraryWhenCompiling () where - -import qualified Test.ChasingBottoms.Tests as Tests -import qualified System.IO as IO -import qualified Language.Haskell.TH as TH - -$(do - b <- TH.runIO $ do putStr "----- Testing the library. -----\n\n" - b <- Tests.main - IO.hFlush IO.stdout - return b - if not b then - fail "Tests failed. Refusing to build library." - else - return [] - ) rmfile ./Test/ChasingBottoms/TestLibraryWhenCompiling.hs }