packages feed

HTF 0.13.1.0 → 0.13.2.1

raw patch · 33 files changed

+193/−220 lines, 33 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Test.Framework.AssertM: ase_location :: AssertStackElem -> Maybe Location
- Test.Framework.AssertM: ase_message :: AssertStackElem -> Maybe String
- Test.Framework.AssertM: instance Applicative AssertBool
- Test.Framework.AssertM: instance AssertM AssertBool
- Test.Framework.AssertM: instance AssertM IO
- Test.Framework.AssertM: instance Eq AssertStackElem
- Test.Framework.AssertM: instance Eq a => Eq (AssertBool a)
- Test.Framework.AssertM: instance Functor AssertBool
- Test.Framework.AssertM: instance Monad AssertBool
- Test.Framework.AssertM: instance Ord AssertStackElem
- Test.Framework.AssertM: instance Ord a => Ord (AssertBool a)
- Test.Framework.AssertM: instance Read AssertStackElem
- Test.Framework.AssertM: instance Read a => Read (AssertBool a)
- Test.Framework.AssertM: instance Show AssertStackElem
- Test.Framework.AssertM: instance Show a => Show (AssertBool a)
- Test.Framework.BlackBoxTest: bbtArgs_dynArgsName :: BBTArgs -> String
- Test.Framework.BlackBoxTest: bbtArgs_stderrDiff :: BBTArgs -> Diff
- Test.Framework.BlackBoxTest: bbtArgs_stderrSuffix :: BBTArgs -> String
- Test.Framework.BlackBoxTest: bbtArgs_stdinSuffix :: BBTArgs -> String
- Test.Framework.BlackBoxTest: bbtArgs_stdoutDiff :: BBTArgs -> Diff
- Test.Framework.BlackBoxTest: bbtArgs_stdoutSuffix :: BBTArgs -> String
- Test.Framework.BlackBoxTest: bbtArgs_verbose :: BBTArgs -> Bool
- Test.Framework.CmdlineOptions: opts_failFast :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_filter :: CmdlineOptions -> TestFilter
- Test.Framework.CmdlineOptions: opts_help :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_historyFile :: CmdlineOptions -> Maybe FilePath
- Test.Framework.CmdlineOptions: opts_listTests :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_machineOutput :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_machineOutputXml :: CmdlineOptions -> Maybe FilePath
- Test.Framework.CmdlineOptions: opts_maxCurTimeMs :: CmdlineOptions -> Maybe Milliseconds
- Test.Framework.CmdlineOptions: opts_maxPrevTimeMs :: CmdlineOptions -> Maybe Milliseconds
- Test.Framework.CmdlineOptions: opts_negated :: CmdlineOptions -> [String]
- Test.Framework.CmdlineOptions: opts_outputFile :: CmdlineOptions -> Maybe FilePath
- Test.Framework.CmdlineOptions: opts_prevFactor :: CmdlineOptions -> Maybe Double
- Test.Framework.CmdlineOptions: opts_quiet :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_shuffle :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_sortByPrevTime :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_split :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_threads :: CmdlineOptions -> Maybe Int
- Test.Framework.CmdlineOptions: opts_timeoutIsSuccess :: CmdlineOptions -> Bool
- Test.Framework.CmdlineOptions: opts_useColors :: CmdlineOptions -> Maybe Bool
- Test.Framework.Colors: instance Eq Color
- Test.Framework.Colors: instance Eq ColorString
- Test.Framework.Colors: instance Eq PrimColor
- Test.Framework.Colors: instance Eq PrimColorString
- Test.Framework.Colors: instance IsString ColorString
- Test.Framework.Colors: instance Read Color
- Test.Framework.Colors: instance Read ColorString
- Test.Framework.Colors: instance Read PrimColor
- Test.Framework.Colors: instance Read PrimColorString
- Test.Framework.Colors: instance Show Color
- Test.Framework.Colors: instance Show ColorString
- Test.Framework.Colors: instance Show PrimColor
- Test.Framework.Colors: instance Show PrimColorString
- Test.Framework.Colors: unColorString :: ColorString -> [PrimColorString]
- Test.Framework.History: htr_result :: HistoricTestResult -> !TestResult
- Test.Framework.History: htr_testId :: HistoricTestResult -> !Text
- Test.Framework.History: htr_timeMs :: HistoricTestResult -> !Milliseconds
- Test.Framework.History: htr_timedOut :: HistoricTestResult -> !Bool
- Test.Framework.History: instance Eq HistoricTestResult
- Test.Framework.History: instance Eq TestHistory
- Test.Framework.History: instance Eq TestRunHistory
- Test.Framework.History: instance FromJSON HistoricTestResult
- Test.Framework.History: instance FromJSON SerializableTestHistory
- Test.Framework.History: instance FromJSON TestResult
- Test.Framework.History: instance FromJSON TestRunHistory
- Test.Framework.History: instance Show HistoricTestResult
- Test.Framework.History: instance Show TestHistory
- Test.Framework.History: instance Show TestRunHistory
- Test.Framework.History: instance ToJSON HistoricTestResult
- Test.Framework.History: instance ToJSON SerializableTestHistory
- Test.Framework.History: instance ToJSON TestResult
- Test.Framework.History: instance ToJSON TestRunHistory
- Test.Framework.JsonOutput: instance HTFJsonObj TestEndEventObj
- Test.Framework.JsonOutput: instance HTFJsonObj TestListObj
- Test.Framework.JsonOutput: instance HTFJsonObj TestResultsObj
- Test.Framework.JsonOutput: instance HTFJsonObj TestStartEventObj
- Test.Framework.JsonOutput: instance ToJSON Location
- Test.Framework.JsonOutput: instance ToJSON TestEndEventObj
- Test.Framework.JsonOutput: instance ToJSON TestListObj
- Test.Framework.JsonOutput: instance ToJSON TestObj
- Test.Framework.JsonOutput: instance ToJSON TestPath
- Test.Framework.JsonOutput: instance ToJSON TestResultsObj
- Test.Framework.JsonOutput: instance ToJSON TestSort
- Test.Framework.JsonOutput: instance ToJSON TestStartEventObj
- Test.Framework.Location: instance Eq Location
- Test.Framework.Location: instance Ord Location
- Test.Framework.Location: instance Read Location
- Test.Framework.Location: instance Show Location
- Test.Framework.Preprocessor: instance Eq Definition
- Test.Framework.Preprocessor: instance Eq ImportDecl
- Test.Framework.Preprocessor: instance Eq ModuleInfo
- Test.Framework.Preprocessor: instance Show Definition
- Test.Framework.Preprocessor: instance Show ImportDecl
- Test.Framework.Preprocessor: instance Show ModuleInfo
- Test.Framework.Pretty: instance Pretty Bool
- Test.Framework.Pretty: instance Pretty Char
- Test.Framework.Pretty: instance Pretty Int
- Test.Framework.Pretty: instance Pretty a => Pretty [a]
- Test.Framework.PrettyHaskell: instance Show MySuperHero
- Test.Framework.PrettyHaskell: instance Show MySuperSuperHero
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Eq QCPendingException
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Exception QCPendingException
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Read QCPendingException
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Show QCPendingException
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Testable a => QCAssertion (WithQCArgs a)
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Testable a => QCAssertion a
- Test.Framework.QuickCheckWrapper: instance [overlap ok] Typeable QCPendingException
- Test.Framework.TestInterface: ftr_callingLocations :: FullTestResult -> [(Maybe String, Location)]
- Test.Framework.TestInterface: ftr_location :: FullTestResult -> Maybe Location
- Test.Framework.TestInterface: ftr_message :: FullTestResult -> Maybe ColorString
- Test.Framework.TestInterface: ftr_result :: FullTestResult -> Maybe TestResult
- Test.Framework.TestInterface: instance Eq FullTestResult
- Test.Framework.TestInterface: instance Eq TestResult
- Test.Framework.TestInterface: instance Exception HTFFailureException
- Test.Framework.TestInterface: instance Read FullTestResult
- Test.Framework.TestInterface: instance Read TestResult
- Test.Framework.TestInterface: instance Show FullTestResult
- Test.Framework.TestInterface: instance Show HTFFailureException
- Test.Framework.TestInterface: instance Show TestResult
- Test.Framework.TestInterface: instance Typeable HTFFailureException
- Test.Framework.TestManager: instance TestableHTF (IO a)
- Test.Framework.TestManager: instance TestableHTF Test
- Test.Framework.TestManager: instance TestableHTF TestSuite
- Test.Framework.TestManager: instance TestableHTF t => TestableHTF [t]
- Test.Framework.TestReporter: instance Eq ReportLevel
- Test.Framework.TestReporter: instance Ord ReportLevel
- Test.Framework.TestTypes: ft_location :: GenFlatTest a -> Maybe Location
- Test.Framework.TestTypes: ft_path :: GenFlatTest a -> TestPath
- Test.Framework.TestTypes: ft_payload :: GenFlatTest a -> a
- Test.Framework.TestTypes: ft_sort :: GenFlatTest a -> TestSort
- Test.Framework.TestTypes: instance AssertionWithTestOptions (IO a)
- Test.Framework.TestTypes: instance AssertionWithTestOptions (WithTestOptions (IO a))
- Test.Framework.TestTypes: instance Eq TestOptions
- Test.Framework.TestTypes: instance Eq TestOutput
- Test.Framework.TestTypes: instance Eq TestReporter
- Test.Framework.TestTypes: instance Eq TestSort
- Test.Framework.TestTypes: instance Eq a => Eq (WithTestOptions a)
- Test.Framework.TestTypes: instance Read TestOptions
- Test.Framework.TestTypes: instance Read TestSort
- Test.Framework.TestTypes: instance Read a => Read (WithTestOptions a)
- Test.Framework.TestTypes: instance Show TestConfig
- Test.Framework.TestTypes: instance Show TestOptions
- Test.Framework.TestTypes: instance Show TestOutput
- Test.Framework.TestTypes: instance Show TestPath
- Test.Framework.TestTypes: instance Show TestReporter
- Test.Framework.TestTypes: instance Show TestSort
- Test.Framework.TestTypes: instance Show a => Show (WithTestOptions a)
- Test.Framework.TestTypes: rgra_errors :: ReportGlobalResultsArg -> [FlatTestResult]
- Test.Framework.TestTypes: rgra_failed :: ReportGlobalResultsArg -> [FlatTestResult]
- Test.Framework.TestTypes: rgra_filtered :: ReportGlobalResultsArg -> [FlatTest]
- Test.Framework.TestTypes: rgra_passed :: ReportGlobalResultsArg -> [FlatTestResult]
- Test.Framework.TestTypes: rgra_pending :: ReportGlobalResultsArg -> [FlatTestResult]
- Test.Framework.TestTypes: rgra_timeMs :: ReportGlobalResultsArg -> Milliseconds
- Test.Framework.TestTypes: rgra_timedOut :: ReportGlobalResultsArg -> [FlatTestResult]
- Test.Framework.TestTypes: rr_callers :: RunResult -> CallStack
- Test.Framework.TestTypes: rr_location :: RunResult -> Maybe Location
- Test.Framework.TestTypes: rr_message :: RunResult -> ColorString
- Test.Framework.TestTypes: rr_result :: RunResult -> TestResult
- Test.Framework.TestTypes: rr_timeout :: RunResult -> Bool
- Test.Framework.TestTypes: rr_wallTimeMs :: RunResult -> Milliseconds
- Test.Framework.TestTypes: tc_failFast :: TestConfig -> Bool
- Test.Framework.TestTypes: tc_filter :: TestConfig -> TestFilter
- Test.Framework.TestTypes: tc_history :: TestConfig -> TestHistory
- Test.Framework.TestTypes: tc_historyFile :: TestConfig -> FilePath
- Test.Framework.TestTypes: tc_maxSingleTestTime :: TestConfig -> Maybe Milliseconds
- Test.Framework.TestTypes: tc_output :: TestConfig -> TestOutput
- Test.Framework.TestTypes: tc_outputXml :: TestConfig -> Maybe FilePath
- Test.Framework.TestTypes: tc_prevFactor :: TestConfig -> Maybe Double
- Test.Framework.TestTypes: tc_quiet :: TestConfig -> Bool
- Test.Framework.TestTypes: tc_reporters :: TestConfig -> [TestReporter]
- Test.Framework.TestTypes: tc_shuffle :: TestConfig -> Bool
- Test.Framework.TestTypes: tc_sortByPrevTime :: TestConfig -> Bool
- Test.Framework.TestTypes: tc_threads :: TestConfig -> Maybe Int
- Test.Framework.TestTypes: tc_timeoutIsSuccess :: TestConfig -> Bool
- Test.Framework.TestTypes: tc_useColors :: TestConfig -> Bool
- Test.Framework.TestTypes: to_parallel :: TestOptions -> Bool
- Test.Framework.TestTypes: tr_id :: TestReporter -> String
- Test.Framework.TestTypes: tr_reportAllTests :: TestReporter -> ReportAllTests
- Test.Framework.TestTypes: tr_reportGlobalResults :: TestReporter -> ReportGlobalResults
- Test.Framework.TestTypes: tr_reportGlobalStart :: TestReporter -> ReportGlobalStart
- Test.Framework.TestTypes: tr_reportTestResult :: TestReporter -> ReportTestResult
- Test.Framework.TestTypes: tr_reportTestStart :: TestReporter -> ReportTestStart
- Test.Framework.TestTypes: ts_index :: TestState -> Int
- Test.Framework.TestTypes: ts_results :: TestState -> [FlatTestResult]
- Test.Framework.TestTypes: wto_options :: WithTestOptions a -> TestOptions
- Test.Framework.TestTypes: wto_payload :: WithTestOptions a -> a
- Test.Framework.ThreadPool: instance Eq StopFlag
- Test.Framework.ThreadPool: instance Read StopFlag
- Test.Framework.ThreadPool: instance Show (WorkItem m b)
- Test.Framework.ThreadPool: instance Show (WorkResult m b)
- Test.Framework.ThreadPool: instance Show StopFlag
- Test.Framework.ThreadPool: tp_run :: ThreadPool m a b -> [ThreadPoolEntry m a b] -> m ()
+ Test.Framework: class WrappableHTF t
+ Test.Framework: wrap :: WrappableHTF t => (Assertion -> Assertion) -> t -> t
+ Test.Framework.AssertM: [ase_location] :: AssertStackElem -> Maybe Location
+ Test.Framework.AssertM: [ase_message] :: AssertStackElem -> Maybe String
+ Test.Framework.AssertM: instance GHC.Base.Applicative Test.Framework.AssertM.AssertBool
+ Test.Framework.AssertM: instance GHC.Base.Functor Test.Framework.AssertM.AssertBool
+ Test.Framework.AssertM: instance GHC.Base.Monad Test.Framework.AssertM.AssertBool
+ Test.Framework.AssertM: instance GHC.Classes.Eq Test.Framework.AssertM.AssertStackElem
+ Test.Framework.AssertM: instance GHC.Classes.Eq a => GHC.Classes.Eq (Test.Framework.AssertM.AssertBool a)
+ Test.Framework.AssertM: instance GHC.Classes.Ord Test.Framework.AssertM.AssertStackElem
+ Test.Framework.AssertM: instance GHC.Classes.Ord a => GHC.Classes.Ord (Test.Framework.AssertM.AssertBool a)
+ Test.Framework.AssertM: instance GHC.Read.Read Test.Framework.AssertM.AssertStackElem
+ Test.Framework.AssertM: instance GHC.Read.Read a => GHC.Read.Read (Test.Framework.AssertM.AssertBool a)
+ Test.Framework.AssertM: instance GHC.Show.Show Test.Framework.AssertM.AssertStackElem
+ Test.Framework.AssertM: instance GHC.Show.Show a => GHC.Show.Show (Test.Framework.AssertM.AssertBool a)
+ Test.Framework.AssertM: instance Test.Framework.AssertM.AssertM GHC.Types.IO
+ Test.Framework.AssertM: instance Test.Framework.AssertM.AssertM Test.Framework.AssertM.AssertBool
+ Test.Framework.BlackBoxTest: [bbtArgs_dynArgsName] :: BBTArgs -> String
+ Test.Framework.BlackBoxTest: [bbtArgs_stderrDiff] :: BBTArgs -> Diff
+ Test.Framework.BlackBoxTest: [bbtArgs_stderrSuffix] :: BBTArgs -> String
+ Test.Framework.BlackBoxTest: [bbtArgs_stdinSuffix] :: BBTArgs -> String
+ Test.Framework.BlackBoxTest: [bbtArgs_stdoutDiff] :: BBTArgs -> Diff
+ Test.Framework.BlackBoxTest: [bbtArgs_stdoutSuffix] :: BBTArgs -> String
+ Test.Framework.BlackBoxTest: [bbtArgs_verbose] :: BBTArgs -> Bool
+ Test.Framework.CmdlineOptions: [opts_failFast] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_filter] :: CmdlineOptions -> TestFilter
+ Test.Framework.CmdlineOptions: [opts_help] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_historyFile] :: CmdlineOptions -> Maybe FilePath
+ Test.Framework.CmdlineOptions: [opts_listTests] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_machineOutputXml] :: CmdlineOptions -> Maybe FilePath
+ Test.Framework.CmdlineOptions: [opts_machineOutput] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_maxCurTimeMs] :: CmdlineOptions -> Maybe Milliseconds
+ Test.Framework.CmdlineOptions: [opts_maxPrevTimeMs] :: CmdlineOptions -> Maybe Milliseconds
+ Test.Framework.CmdlineOptions: [opts_negated] :: CmdlineOptions -> [String]
+ Test.Framework.CmdlineOptions: [opts_outputFile] :: CmdlineOptions -> Maybe FilePath
+ Test.Framework.CmdlineOptions: [opts_prevFactor] :: CmdlineOptions -> Maybe Double
+ Test.Framework.CmdlineOptions: [opts_quiet] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_repeat] :: CmdlineOptions -> Int
+ Test.Framework.CmdlineOptions: [opts_shuffle] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_sortByPrevTime] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_split] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_threads] :: CmdlineOptions -> Maybe Int
+ Test.Framework.CmdlineOptions: [opts_timeoutIsSuccess] :: CmdlineOptions -> Bool
+ Test.Framework.CmdlineOptions: [opts_useColors] :: CmdlineOptions -> Maybe Bool
+ Test.Framework.Colors: [unColorString] :: ColorString -> [PrimColorString]
+ Test.Framework.Colors: infixr 5 +++
+ Test.Framework.Colors: instance Data.String.IsString Test.Framework.Colors.ColorString
+ Test.Framework.Colors: instance GHC.Classes.Eq Test.Framework.Colors.Color
+ Test.Framework.Colors: instance GHC.Classes.Eq Test.Framework.Colors.ColorString
+ Test.Framework.Colors: instance GHC.Classes.Eq Test.Framework.Colors.PrimColor
+ Test.Framework.Colors: instance GHC.Classes.Eq Test.Framework.Colors.PrimColorString
+ Test.Framework.Colors: instance GHC.Read.Read Test.Framework.Colors.Color
+ Test.Framework.Colors: instance GHC.Read.Read Test.Framework.Colors.ColorString
+ Test.Framework.Colors: instance GHC.Read.Read Test.Framework.Colors.PrimColor
+ Test.Framework.Colors: instance GHC.Read.Read Test.Framework.Colors.PrimColorString
+ Test.Framework.Colors: instance GHC.Show.Show Test.Framework.Colors.Color
+ Test.Framework.Colors: instance GHC.Show.Show Test.Framework.Colors.ColorString
+ Test.Framework.Colors: instance GHC.Show.Show Test.Framework.Colors.PrimColor
+ Test.Framework.Colors: instance GHC.Show.Show Test.Framework.Colors.PrimColorString
+ Test.Framework.History: [htr_result] :: HistoricTestResult -> !TestResult
+ Test.Framework.History: [htr_testId] :: HistoricTestResult -> !Text
+ Test.Framework.History: [htr_timeMs] :: HistoricTestResult -> !Milliseconds
+ Test.Framework.History: [htr_timedOut] :: HistoricTestResult -> !Bool
+ Test.Framework.History: instance Data.Aeson.Types.FromJSON.FromJSON Test.Framework.History.HistoricTestResult
+ Test.Framework.History: instance Data.Aeson.Types.FromJSON.FromJSON Test.Framework.History.SerializableTestHistory
+ Test.Framework.History: instance Data.Aeson.Types.FromJSON.FromJSON Test.Framework.History.TestRunHistory
+ Test.Framework.History: instance Data.Aeson.Types.FromJSON.FromJSON Test.Framework.TestInterface.TestResult
+ Test.Framework.History: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.History.HistoricTestResult
+ Test.Framework.History: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.History.SerializableTestHistory
+ Test.Framework.History: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.History.TestRunHistory
+ Test.Framework.History: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.TestInterface.TestResult
+ Test.Framework.History: instance GHC.Classes.Eq Test.Framework.History.HistoricTestResult
+ Test.Framework.History: instance GHC.Classes.Eq Test.Framework.History.TestHistory
+ Test.Framework.History: instance GHC.Classes.Eq Test.Framework.History.TestRunHistory
+ Test.Framework.History: instance GHC.Show.Show Test.Framework.History.HistoricTestResult
+ Test.Framework.History: instance GHC.Show.Show Test.Framework.History.TestHistory
+ Test.Framework.History: instance GHC.Show.Show Test.Framework.History.TestRunHistory
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.JsonOutput.TestEndEventObj
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.JsonOutput.TestListObj
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.JsonOutput.TestObj
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.JsonOutput.TestResultsObj
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.JsonOutput.TestStartEventObj
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.Location.Location
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.TestTypes.TestPath
+ Test.Framework.JsonOutput: instance Data.Aeson.Types.ToJSON.ToJSON Test.Framework.TestTypes.TestSort
+ Test.Framework.JsonOutput: instance Test.Framework.JsonOutput.HTFJsonObj Test.Framework.JsonOutput.TestEndEventObj
+ Test.Framework.JsonOutput: instance Test.Framework.JsonOutput.HTFJsonObj Test.Framework.JsonOutput.TestListObj
+ Test.Framework.JsonOutput: instance Test.Framework.JsonOutput.HTFJsonObj Test.Framework.JsonOutput.TestResultsObj
+ Test.Framework.JsonOutput: instance Test.Framework.JsonOutput.HTFJsonObj Test.Framework.JsonOutput.TestStartEventObj
+ Test.Framework.Location: instance GHC.Classes.Eq Test.Framework.Location.Location
+ Test.Framework.Location: instance GHC.Classes.Ord Test.Framework.Location.Location
+ Test.Framework.Location: instance GHC.Read.Read Test.Framework.Location.Location
+ Test.Framework.Location: instance GHC.Show.Show Test.Framework.Location.Location
+ Test.Framework.Preprocessor: instance GHC.Classes.Eq Test.Framework.Preprocessor.Definition
+ Test.Framework.Preprocessor: instance GHC.Classes.Eq Test.Framework.Preprocessor.ImportDecl
+ Test.Framework.Preprocessor: instance GHC.Classes.Eq Test.Framework.Preprocessor.ModuleInfo
+ Test.Framework.Preprocessor: instance GHC.Show.Show Test.Framework.Preprocessor.Definition
+ Test.Framework.Preprocessor: instance GHC.Show.Show Test.Framework.Preprocessor.ImportDecl
+ Test.Framework.Preprocessor: instance GHC.Show.Show Test.Framework.Preprocessor.ModuleInfo
+ Test.Framework.Pretty: instance Test.Framework.Pretty.Pretty GHC.Types.Bool
+ Test.Framework.Pretty: instance Test.Framework.Pretty.Pretty GHC.Types.Char
+ Test.Framework.Pretty: instance Test.Framework.Pretty.Pretty GHC.Types.Int
+ Test.Framework.Pretty: instance Test.Framework.Pretty.Pretty a => Test.Framework.Pretty.Pretty [a]
+ Test.Framework.PrettyHaskell: instance GHC.Show.Show Test.Framework.PrettyHaskell.MySuperHero
+ Test.Framework.PrettyHaskell: instance GHC.Show.Show Test.Framework.PrettyHaskell.MySuperSuperHero
+ Test.Framework.QuickCheckWrapper: class QCAssertion a
+ Test.Framework.QuickCheckWrapper: instance GHC.Classes.Eq Test.Framework.QuickCheckWrapper.QCPendingException
+ Test.Framework.QuickCheckWrapper: instance GHC.Exception.Exception Test.Framework.QuickCheckWrapper.QCPendingException
+ Test.Framework.QuickCheckWrapper: instance GHC.Read.Read Test.Framework.QuickCheckWrapper.QCPendingException
+ Test.Framework.QuickCheckWrapper: instance GHC.Show.Show Test.Framework.QuickCheckWrapper.QCPendingException
+ Test.Framework.QuickCheckWrapper: instance Test.QuickCheck.Property.Testable a => Test.Framework.QuickCheckWrapper.QCAssertion (Test.Framework.QuickCheckWrapper.WithQCArgs a)
+ Test.Framework.QuickCheckWrapper: instance Test.QuickCheck.Property.Testable a => Test.Framework.QuickCheckWrapper.QCAssertion a
+ Test.Framework.TestInterface: [ftr_callingLocations] :: FullTestResult -> [(Maybe String, Location)]
+ Test.Framework.TestInterface: [ftr_location] :: FullTestResult -> Maybe Location
+ Test.Framework.TestInterface: [ftr_message] :: FullTestResult -> Maybe ColorString
+ Test.Framework.TestInterface: [ftr_result] :: FullTestResult -> Maybe TestResult
+ Test.Framework.TestInterface: instance GHC.Classes.Eq Test.Framework.TestInterface.FullTestResult
+ Test.Framework.TestInterface: instance GHC.Classes.Eq Test.Framework.TestInterface.TestResult
+ Test.Framework.TestInterface: instance GHC.Exception.Exception Test.Framework.TestInterface.HTFFailureException
+ Test.Framework.TestInterface: instance GHC.Read.Read Test.Framework.TestInterface.FullTestResult
+ Test.Framework.TestInterface: instance GHC.Read.Read Test.Framework.TestInterface.TestResult
+ Test.Framework.TestInterface: instance GHC.Show.Show Test.Framework.TestInterface.FullTestResult
+ Test.Framework.TestInterface: instance GHC.Show.Show Test.Framework.TestInterface.HTFFailureException
+ Test.Framework.TestInterface: instance GHC.Show.Show Test.Framework.TestInterface.TestResult
+ Test.Framework.TestManager: class WrappableHTF t
+ Test.Framework.TestManager: instance Test.Framework.TestManager.TestableHTF (GHC.Types.IO a)
+ Test.Framework.TestManager: instance Test.Framework.TestManager.TestableHTF Test.Framework.TestTypes.Test
+ Test.Framework.TestManager: instance Test.Framework.TestManager.TestableHTF Test.Framework.TestTypes.TestSuite
+ Test.Framework.TestManager: instance Test.Framework.TestManager.TestableHTF t => Test.Framework.TestManager.TestableHTF [t]
+ Test.Framework.TestManager: instance Test.Framework.TestManager.WrappableHTF Test.Framework.TestTypes.Test
+ Test.Framework.TestManager: instance Test.Framework.TestManager.WrappableHTF Test.Framework.TestTypes.TestSuite
+ Test.Framework.TestManager: wrap :: WrappableHTF t => (Assertion -> Assertion) -> t -> t
+ Test.Framework.TestManager: wrappableTests :: [([Char], IO ())]
+ Test.Framework.TestReporter: instance GHC.Classes.Eq Test.Framework.TestReporter.ReportLevel
+ Test.Framework.TestReporter: instance GHC.Classes.Ord Test.Framework.TestReporter.ReportLevel
+ Test.Framework.TestTypes: [ft_location] :: GenFlatTest a -> Maybe Location
+ Test.Framework.TestTypes: [ft_path] :: GenFlatTest a -> TestPath
+ Test.Framework.TestTypes: [ft_payload] :: GenFlatTest a -> a
+ Test.Framework.TestTypes: [ft_sort] :: GenFlatTest a -> TestSort
+ Test.Framework.TestTypes: [rgra_errors] :: ReportGlobalResultsArg -> [FlatTestResult]
+ Test.Framework.TestTypes: [rgra_failed] :: ReportGlobalResultsArg -> [FlatTestResult]
+ Test.Framework.TestTypes: [rgra_filtered] :: ReportGlobalResultsArg -> [FlatTest]
+ Test.Framework.TestTypes: [rgra_passed] :: ReportGlobalResultsArg -> [FlatTestResult]
+ Test.Framework.TestTypes: [rgra_pending] :: ReportGlobalResultsArg -> [FlatTestResult]
+ Test.Framework.TestTypes: [rgra_timeMs] :: ReportGlobalResultsArg -> Milliseconds
+ Test.Framework.TestTypes: [rgra_timedOut] :: ReportGlobalResultsArg -> [FlatTestResult]
+ Test.Framework.TestTypes: [rr_callers] :: RunResult -> CallStack
+ Test.Framework.TestTypes: [rr_location] :: RunResult -> Maybe Location
+ Test.Framework.TestTypes: [rr_message] :: RunResult -> ColorString
+ Test.Framework.TestTypes: [rr_result] :: RunResult -> TestResult
+ Test.Framework.TestTypes: [rr_timeout] :: RunResult -> Bool
+ Test.Framework.TestTypes: [rr_wallTimeMs] :: RunResult -> Milliseconds
+ Test.Framework.TestTypes: [tc_failFast] :: TestConfig -> Bool
+ Test.Framework.TestTypes: [tc_filter] :: TestConfig -> TestFilter
+ Test.Framework.TestTypes: [tc_historyFile] :: TestConfig -> FilePath
+ Test.Framework.TestTypes: [tc_history] :: TestConfig -> TestHistory
+ Test.Framework.TestTypes: [tc_maxSingleTestTime] :: TestConfig -> Maybe Milliseconds
+ Test.Framework.TestTypes: [tc_outputXml] :: TestConfig -> Maybe FilePath
+ Test.Framework.TestTypes: [tc_output] :: TestConfig -> TestOutput
+ Test.Framework.TestTypes: [tc_prevFactor] :: TestConfig -> Maybe Double
+ Test.Framework.TestTypes: [tc_quiet] :: TestConfig -> Bool
+ Test.Framework.TestTypes: [tc_repeat] :: TestConfig -> Int
+ Test.Framework.TestTypes: [tc_reporters] :: TestConfig -> [TestReporter]
+ Test.Framework.TestTypes: [tc_shuffle] :: TestConfig -> Bool
+ Test.Framework.TestTypes: [tc_sortByPrevTime] :: TestConfig -> Bool
+ Test.Framework.TestTypes: [tc_threads] :: TestConfig -> Maybe Int
+ Test.Framework.TestTypes: [tc_timeoutIsSuccess] :: TestConfig -> Bool
+ Test.Framework.TestTypes: [tc_useColors] :: TestConfig -> Bool
+ Test.Framework.TestTypes: [to_parallel] :: TestOptions -> Bool
+ Test.Framework.TestTypes: [tr_id] :: TestReporter -> String
+ Test.Framework.TestTypes: [tr_reportAllTests] :: TestReporter -> ReportAllTests
+ Test.Framework.TestTypes: [tr_reportGlobalResults] :: TestReporter -> ReportGlobalResults
+ Test.Framework.TestTypes: [tr_reportGlobalStart] :: TestReporter -> ReportGlobalStart
+ Test.Framework.TestTypes: [tr_reportTestResult] :: TestReporter -> ReportTestResult
+ Test.Framework.TestTypes: [tr_reportTestStart] :: TestReporter -> ReportTestStart
+ Test.Framework.TestTypes: [ts_index] :: TestState -> Int
+ Test.Framework.TestTypes: [ts_results] :: TestState -> [FlatTestResult]
+ Test.Framework.TestTypes: [wto_options] :: WithTestOptions a -> TestOptions
+ Test.Framework.TestTypes: [wto_payload] :: WithTestOptions a -> a
+ Test.Framework.TestTypes: instance GHC.Classes.Eq Test.Framework.TestTypes.TestOptions
+ Test.Framework.TestTypes: instance GHC.Classes.Eq Test.Framework.TestTypes.TestOutput
+ Test.Framework.TestTypes: instance GHC.Classes.Eq Test.Framework.TestTypes.TestReporter
+ Test.Framework.TestTypes: instance GHC.Classes.Eq Test.Framework.TestTypes.TestSort
+ Test.Framework.TestTypes: instance GHC.Classes.Eq a => GHC.Classes.Eq (Test.Framework.TestTypes.WithTestOptions a)
+ Test.Framework.TestTypes: instance GHC.Read.Read Test.Framework.TestTypes.TestOptions
+ Test.Framework.TestTypes: instance GHC.Read.Read Test.Framework.TestTypes.TestSort
+ Test.Framework.TestTypes: instance GHC.Read.Read a => GHC.Read.Read (Test.Framework.TestTypes.WithTestOptions a)
+ Test.Framework.TestTypes: instance GHC.Show.Show Test.Framework.TestTypes.TestConfig
+ Test.Framework.TestTypes: instance GHC.Show.Show Test.Framework.TestTypes.TestOptions
+ Test.Framework.TestTypes: instance GHC.Show.Show Test.Framework.TestTypes.TestOutput
+ Test.Framework.TestTypes: instance GHC.Show.Show Test.Framework.TestTypes.TestPath
+ Test.Framework.TestTypes: instance GHC.Show.Show Test.Framework.TestTypes.TestReporter
+ Test.Framework.TestTypes: instance GHC.Show.Show Test.Framework.TestTypes.TestSort
+ Test.Framework.TestTypes: instance GHC.Show.Show a => GHC.Show.Show (Test.Framework.TestTypes.WithTestOptions a)
+ Test.Framework.TestTypes: instance Test.Framework.TestTypes.AssertionWithTestOptions (GHC.Types.IO a)
+ Test.Framework.TestTypes: instance Test.Framework.TestTypes.AssertionWithTestOptions (Test.Framework.TestTypes.WithTestOptions (GHC.Types.IO a))
+ Test.Framework.ThreadPool: [tp_run] :: ThreadPool m a b -> [ThreadPoolEntry m a b] -> m ()
+ Test.Framework.ThreadPool: instance GHC.Classes.Eq Test.Framework.ThreadPool.StopFlag
+ Test.Framework.ThreadPool: instance GHC.Read.Read Test.Framework.ThreadPool.StopFlag
+ Test.Framework.ThreadPool: instance GHC.Show.Show (Test.Framework.ThreadPool.WorkItem m b)
+ Test.Framework.ThreadPool: instance GHC.Show.Show (Test.Framework.ThreadPool.WorkResult m b)
+ Test.Framework.ThreadPool: instance GHC.Show.Show Test.Framework.ThreadPool.StopFlag
- Test.Framework.CmdlineOptions: CmdlineOptions :: Bool -> TestFilter -> Bool -> [String] -> Maybe Int -> Bool -> Bool -> Maybe FilePath -> Maybe Bool -> Maybe FilePath -> Bool -> Bool -> Maybe FilePath -> Bool -> Bool -> Maybe Milliseconds -> Maybe Milliseconds -> Maybe Double -> Bool -> CmdlineOptions
+ Test.Framework.CmdlineOptions: CmdlineOptions :: Bool -> TestFilter -> Bool -> [String] -> Maybe Int -> Bool -> Bool -> Maybe FilePath -> Maybe Bool -> Maybe FilePath -> Bool -> Bool -> Maybe FilePath -> Bool -> Bool -> Maybe Milliseconds -> Maybe Milliseconds -> Maybe Double -> Bool -> Int -> CmdlineOptions
- Test.Framework.HUnitWrapper: hunitWrapperTests :: [(String, IO ())]
+ Test.Framework.HUnitWrapper: hunitWrapperTests :: [([Char], IO ())]
- Test.Framework.History: historyTests :: [(String, IO ())]
+ Test.Framework.History: historyTests :: [([Char], IO ())]
- Test.Framework.Preprocessor: preprocessorTests :: [(String, IO ())]
+ Test.Framework.Preprocessor: preprocessorTests :: [([Char], IO ())]
- Test.Framework.QuickCheckWrapper: qcAssertion :: QCAssertion t => t -> Assertion
+ Test.Framework.QuickCheckWrapper: qcAssertion :: (QCAssertion t) => t -> Assertion
- Test.Framework.QuickCheckWrapper: withQCArgs :: Testable a => (Args -> Args) -> a -> WithQCArgs a
+ Test.Framework.QuickCheckWrapper: withQCArgs :: (Testable a) => (Args -> Args) -> a -> WithQCArgs a
- Test.Framework.TestTypes: TestConfig :: Bool -> Maybe Int -> Bool -> TestOutput -> Maybe FilePath -> TestFilter -> [TestReporter] -> Bool -> FilePath -> TestHistory -> Bool -> Bool -> Bool -> Maybe Milliseconds -> Maybe Double -> TestConfig
+ Test.Framework.TestTypes: TestConfig :: Bool -> Maybe Int -> Bool -> TestOutput -> Maybe FilePath -> TestFilter -> [TestReporter] -> Bool -> FilePath -> TestHistory -> Bool -> Bool -> Bool -> Maybe Milliseconds -> Maybe Double -> Int -> TestConfig

Files

HTF.cabal view
@@ -1,5 +1,5 @@ Name:             HTF-Version:          0.13.1.0+Version:          0.13.2.1 License:          LGPL License-File:     LICENSE Copyright:        (c) 2005-2015 Stefan Wehr@@ -30,59 +30,6 @@     blog article (<http://factisresearch.blogspot.de/2011/10/new-version-of-htf-with-diffs-colors.html>)     demonstrating HTF's coloring, pretty-printing and diff functionality. -    .--    /HEADS UP, backwards incomatibility with prior versions:/--    .--    In version 0.10.0.0, the following changes could break code compiled against version 0.9.*:--    .--    * "Test.Framework" now longer exports all of "Test.Framework.TestManager" and-      "Test.Framework.BlackBoxTest". For modules that only define tests, no changes-      should be necessary. However, you likely need to adjust your test runner-      module by importing "Test.Framework.TestManager" and possibly "Test.Framework.BlackBoxTest".--    .--    * Some reorganization in "Test.Framework.TestManager" and related modules, introduction-      of "Test.Framework.TestTypes". Usually, your code should not be affected-      by these changes.--    .-    Starting with version 0.9.0.0, HTF uses a new strategy-    for collecting the testcases defined in your project-    (see "Test.Framework.Tutorial" for a description of this strategy).-    If you used version 0.8.* or earlier of HTF, this /will break your build!/-    However, it's rather easy to bring you project in line with the new HTF-    version. Here are the steps that will most likely resolve-    your backwards incompatibility problems:--    .--    * If a module exports the @allHTFTests@ symbol, this export must-      be changed to @htf_thisModulesTests@.--    .--    * If an import declaration of some module hides the @allHTFTests@-      symbol, you can simply remove the hiding clause for @allHTFTests@.--    .--    * If a module collects and executes tests from several other modules,-      the collecting module has to be changed as follows: add-      @&#x7b;-&#x23; OPTIONS_GHC -F -pgmF htfpp &#x23;-&#x7d;@ to the top-      of the collecting module, import-      the other modules with the @&#x7b;-&#x40; HTF_TESTS &#x40;-&#x7d;@-      annotation, use the symbol @htf_importedTests@ for referencing-      the imported tests. See "Test.Framework.Tutorial" for details.--Tested-With:-                  GHC==7.6.2,-                  GHC==7.8.2 Build-Type:       Simple Cabal-Version:    >= 1.10 Extra-Source-Files:@@ -90,7 +37,6 @@   TODO.org   ChangeLog   tests/bbt/should_fail/BBTArgs-  -- tests/bbt/should_fail/*.in   tests/bbt/should_fail/*.err   tests/bbt/should_fail/*.out   tests/bbt/should_fail/*.x@@ -125,8 +71,9 @@   sample/bbt-dir/should-fail/z.num   sample/bbt-dir/should-pass/x.num   sample/bbt-dir/should-pass/x.out-  run-all-tests-for-all-compilers.sh-  run-all-tests.sh+  scripts/local-htfpp+  scripts/run-sample+ Source-Repository head   Type:           git   Location:       http://github.com/skogsbaer/HTF.git@@ -153,7 +100,7 @@   Build-Depends:    Diff >= 0.3,                     HUnit >= 1.2.5,                     QuickCheck >= 2.3,-                    aeson >= 0.6,+                    aeson < 0.10 || >= 0.11,                     array,                     base == 4.*,                     base64-bytestring,@@ -236,7 +183,8 @@   Default-language:  Haskell2010   Other-Modules:     Foo.A, Foo.B, TestHTFHunitBackwardsCompatible, FailFast, MaxCurTime,-    MaxPrevTime, PrevFactor, SortByPrevTime, UniqTests1, UniqTests2, Quasi+    MaxPrevTime, PrevFactor, SortByPrevTime, UniqTests1, UniqTests2, Quasi,+    Tutorial, Repeat  Test-Suite TestThreadPools   Main-is:           ThreadPoolTest.hs
README.md view
@@ -1,5 +1,8 @@ # HTF - The Haskell Test Framework +[![Build Status](https://travis-ci.org/skogsbaer/HTF.svg?branch=master)](https://travis-ci.org/skogsbaer/HTF)+[![Hackage](https://img.shields.io/hackage/v/HTF.svg)](http://hackage.haskell.org/package/HTF)+ * Documentation:     http://hackage.haskell.org/package/HTF * Source Repository: https://github.com/skogsbaer/HTF/ * Issue tracker:     https://github.com/skogsbaer/HTF/issues?state=open@@ -9,8 +12,8 @@ ## Summary  The Haskell Test Framework (HTF for short) lets you define unit tests-(http://hunit.sourceforge.net), QuickCheck properties-(http://www.cs.chalmers.se/~rjmh/QuickCheck/), and black box tests in an+(http://hackage.haskell.org/package/HUnit), QuickCheck properties+(https://hackage.haskell.org/package/QuickCheck), and black box tests in an easy and convenient way. HTF uses a custom preprocessor that collects test definitions automatically. Furthermore, the preprocessor allows HTF to report failing test cases with exact file name and line number
Test/Framework.hs view
@@ -37,7 +37,8 @@   module Test.Framework.AssertM,    -- * Organizing tests-  TM.makeTestSuite, TM.TestSuite, TM.htfMain, TM.htfMainWithArgs, Loc.makeLoc, TM.runTest+  TM.makeTestSuite, TM.TestSuite, TM.htfMain, TM.htfMainWithArgs, Loc.makeLoc, TM.runTest,+  TM.WrappableHTF(..)  ) where 
Test/Framework/CmdlineOptions.hs view
@@ -89,8 +89,9 @@     , opts_sortByPrevTime :: Bool       -- ^ Sort tests by their previous run times (ascending). Default: 'False'     , opts_maxPrevTimeMs :: Maybe Milliseconds -- ^ Ignore tests with a runtime greater than given in a previous test run.     , opts_maxCurTimeMs :: Maybe Milliseconds  -- ^ Abort tests that run more than the given milliseconds.-    , opts_prevFactor :: Maybe Double -- ^ Warn if a test runs more than N times slower than in a previosu run.+    , opts_prevFactor :: Maybe Double -- ^ Warn if a test runs more than N times slower than in a previous run.     , opts_timeoutIsSuccess :: Bool -- ^ Do not regard test timeout as an error.+    , opts_repeat :: Int                 -- ^ Number of times to repeat tests selected on the command line before reporting them as a success.     }  {- |@@ -117,6 +118,7 @@     , opts_maxCurTimeMs = Nothing     , opts_prevFactor = Nothing     , opts_timeoutIsSuccess = False+    , opts_repeat = 1     }  processorCount :: Int@@ -140,9 +142,9 @@     , Option ['j']     ["threads"]              (OptArg (\ms o -> parseThreads ms >>= \i -> Right $ o { opts_threads = Just i }) "N")              ("Run N tests in parallel, default N=" ++ show processorCount ++ ".")-    , Option []        ["deterministic"]-             (NoArg (\o -> Right $ o { opts_shuffle = False }))-             "Do not shuffle tests when executing them in parallel."+    , Option []        ["shuffle"]+             (ReqArg (\s o -> parseBool s >>= \b -> Right $ o { opts_shuffle = b }) "BOOL")+             "Shuffle test order. Default: false"     , Option ['o']     ["output-file"]              (ReqArg (\s o -> Right $ o { opts_outputFile = Just s }) "FILE")              "Name of output file."@@ -181,6 +183,10 @@     , Option []        ["timeout-is-success"]              (NoArg (\o -> Right $ o { opts_timeoutIsSuccess = True }))              "Do not regard a test timeout as an error."+    , Option []        ["repeat"]+             (ReqArg (\s o -> parseRead "--repeat" s >>= \(i::Int) ->+                              Right $ o { opts_repeat = i}) "NUMBER")+             "Execute the tests selected on the command line NUMBER times."     , Option ['h']     ["help"]              (NoArg (\o -> Right $ o { opts_help = True }))              "Display this message."@@ -213,7 +219,7 @@ >   -n PATTERN  --not=PATTERN               Tests to exclude. >   -l          --list                      List all matching tests. >   -j[N]       --threads[=N]               Run N tests in parallel, default N=1.->               --deterministic             Do not shuffle tests when executing them in parallel.+>               --shuffle=BOOL              Shuffle test order. Default: false >   -o FILE     --output-file=FILE          Name of output file. >               --json                      Output results in machine-readable JSON format (incremental). >               --xml=FILE                  Output results in junit-style XML format.@@ -235,6 +241,10 @@     case getOpt Permute optionDescriptions args of       (optTrans, tests, []) ->           do opts <- foldM (\o f -> f o) defaultCmdlineOptions optTrans+             when (opts_shuffle opts && opts_sortByPrevTime opts) $+                 Left ("Options --shuffle=true and --sort-by-prev-time are in conflict. " +++                       "Can only use one of both.\n\n" +++                       usageInfo usageHeader optionDescriptions)              case (opts_outputFile opts, opts_split opts) of                (Nothing, True) -> Left ("Option --split requires -o or --output-file\n\n" ++                                         usageInfo usageHeader optionDescriptions)@@ -297,6 +307,7 @@                            , tc_maxSingleTestTime = opts_maxCurTimeMs opts                            , tc_prevFactor = opts_prevFactor opts                            , tc_timeoutIsSuccess = opts_timeoutIsSuccess opts+                           , tc_repeat = opts_repeat opts                            }     where #ifdef mingw32_HOST_OS
Test/Framework/QuickCheckWrapper.hs view
@@ -1,5 +1,9 @@-{-# LANGUAGE FlexibleInstances,OverlappingInstances,UndecidableInstances,-             ExistentialQuantification,DeriveDataTypeable,ScopedTypeVariables,CPP #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE CPP #-}  -- -- Copyright (c) 2005,2009-2012 Stefan Wehr - http://www.stefanwehr.de@@ -33,6 +37,7 @@   -- * Arguments for evaluating properties   defaultArgs, getCurrentArgs, setDefaultArgs,   withQCArgs, WithQCArgs, setReplayFromString,+  QCAssertion,    -- * Pending properties   qcPending,@@ -195,11 +200,11 @@     argsModifier :: a -> (Args -> Args)     testable :: a -> AnyTestable -instance Testable a => QCAssertion a where+instance {-# OVERLAPPABLE #-} Testable a => QCAssertion a where     argsModifier _ = id     testable = AnyTestable -instance Testable a => QCAssertion (WithQCArgs a) where+instance {-# OVERLAPPING  #-} Testable a => QCAssertion (WithQCArgs a) where     argsModifier (WithQCArgs f _) = f     testable (WithQCArgs _ x) = AnyTestable x 
Test/Framework/TestManager.hs view
@@ -37,12 +37,16 @@    -- * Organzing tests   TestableHTF,+  WrappableHTF(..),    makeQuickCheckTest, makeUnitTest, makeBlackBoxTest, makeTestSuite,   makeAnonTestSuite,   addToTestSuite, testSuiteAsTest, -  flattenTest+  flattenTest,++  -- * Tests (for internal use)+  wrappableTests ) where  import Control.Monad.RWS@@ -68,6 +72,7 @@ import Test.Framework.ThreadPool import Test.Framework.History +import qualified Test.HUnit as HU -- | Construct a test where the given 'Assertion' checks a quick check property. -- Mainly used internally by the htfpp preprocessor. makeQuickCheckTest :: TestID -> Location -> Assertion -> Test@@ -101,6 +106,26 @@ addToTestSuite (TestSuite id ts) ts' = TestSuite id (ts ++ ts') addToTestSuite (AnonTestSuite ts) ts' = AnonTestSuite (ts ++ ts') +-- | Kind of specialised 'Functor' type class for tests, which allows you to+-- modify the 'Assertion's of the 'WrappableHTF'-thing without changing any+-- test code.+--+-- E.g. if you want to add timeouts to all tests of a module, you could write:+--+-- > addTimeout test = timeout 100 test >>= assertJustVerbose "Timeout exceeded"+-- > testsWithTimeouts = wrap addTimeout htf_thisModulesTests+class WrappableHTF t where+    wrap :: (Assertion -> Assertion) -> t -> t++instance WrappableHTF TestSuite where+    wrap wrapper (TestSuite tid tests) = TestSuite tid $ map (wrap wrapper) tests+    wrap wrapper (AnonTestSuite tests) = AnonTestSuite $ map (wrap wrapper) tests++instance WrappableHTF Test where+    wrap wrapper (BaseTest ts tid loc topt assertion) =+        BaseTest ts tid loc topt (wrapper assertion)+    wrap wrapper (CompoundTest suite) = CompoundTest $ wrap wrapper suite+ -- | A type class for things that can be run as tests. -- Mainly used internally. class TestableHTF t where@@ -219,16 +244,28 @@       pre = reportTestStart ft       action _ =           let run = performTestHTF (wto_payload (ft_payload ft))-          in case maxRunTime tc ft of-               Nothing ->-                   do (res, time) <- measure run-                      return (PrimTestResultNoTimeout res, time)-               Just maxMs ->-                    do mx <- timeout (1000 * maxMs) $ measure run-                       case mx of-                         Nothing -> return (PrimTestResultTimeout, maxMs)-                         Just (res, time) ->-                             return (PrimTestResultNoTimeout res, time)+              runWithTimeout =+                  case maxRunTime tc ft of+                    Nothing ->+                        do (res, time) <- measure run+                           return (PrimTestResultNoTimeout res, time)+                    Just maxMs ->+                         do mx <- timeout (1000 * maxMs) $ measure run+                            case mx of+                              Nothing -> return (PrimTestResultTimeout, maxMs)+                              Just (res, time) ->+                                  return (PrimTestResultNoTimeout res, time)+              isPass primTestRes =+                  case primTestRes of+                    PrimTestResultNoTimeout fullTestRes ->+                        ftr_result fullTestRes == Just Pass+                    PrimTestResultTimeout -> False+              iterRunWithTimeout i =+                  do (primTestRes, time) <- runWithTimeout+                     if isPass primTestRes && i >= 2+                       then iterRunWithTimeout (i-1)+                       else return (primTestRes, time)+          in iterRunWithTimeout (tc_repeat tc)       post excOrResult =           let (testResult, time) =                  case excOrResult of@@ -282,31 +319,31 @@                  Fail -> DoStop                  Error -> DoStop -runAllFlatTests :: TestConfig -> [FlatTest] -> TR ()-runAllFlatTests tc tests' =-    do reportGlobalStart tests-       tc <- ask+runAllFlatTests :: [FlatTest] -> TR ()+runAllFlatTests tests' =+    do tc <- ask+       tests <- orderTests tc tests'+       reportGlobalStart tests        case tc_threads tc of          Nothing ->              let entries = map (mkFlatTestRunner tc) tests              in tp_run sequentialThreadPool entries          Just i ->              let (ptests, stests) = List.partition (\t -> to_parallel (wto_options (ft_payload t))) tests-                 pentries' = map (mkFlatTestRunner tc) ptests+                 pentries = map (mkFlatTestRunner tc) ptests                  sentries = map (mkFlatTestRunner tc) stests              in do tp <- parallelThreadPool i-                   pentries <- if tc_shuffle tc-                               then liftIO (shuffleIO pentries')-                               else return pentries'                    tp_run tp pentries                    tp_run sequentialThreadPool sentries     where-      tests = sortTests tests'-      sortTests ts =-          if not (tc_sortByPrevTime tc)-          then ts-          else map snd $ List.sortBy compareTests (map (\t -> (historyKey t, t)) ts)-      compareTests (t1, _) (t2, _) =+      orderTests tc ts+          | tc_sortByPrevTime tc = return $ sortByPrevTime tc ts+          | tc_shuffle tc = shuffleTests ts+          | otherwise = return ts+      shuffleTests = liftIO . shuffleIO+      sortByPrevTime tc ts =+              map snd $ List.sortBy (compareTests tc) (map (\t -> (historyKey t, t)) ts)+      compareTests tc (t1, _) (t2, _) =           case (max (fmap htr_timeMs (findHistoricSuccessfulTestResult t1 (tc_history tc)))                     (fmap htr_timeMs (findHistoricTestResult t1 (tc_history tc)))                ,max (fmap htr_timeMs (findHistoricSuccessfulTestResult t2 (tc_history tc)))@@ -407,7 +444,7 @@         startTime <- getCurrentTime         ((_, s, _), time) <-             measure $-            runRWST (runAllFlatTests tc activeTests) tc initTestState+            runRWST (runAllFlatTests activeTests) tc initTestState         let results = reverse (ts_results s)             passed = filter (\ft -> (rr_result . ft_payload) ft == Pass) results             pending = filter (\ft -> (rr_result . ft_payload) ft == Pending) results@@ -458,3 +495,14 @@ htfMainWithArgs args tests =     do ecode <- runTestWithArgs args tests        exitWith ecode++testWrapCanCauseFailure :: IO ()+testWrapCanCauseFailure =+    do HU.assertEqual "plain unit test passes" ExitSuccess =<< runTest unitTest+       HU.assertEqual "wrapped unit test fails" (ExitFailure 2) =<< runTest wrappedUnitTest+    where+      unitTest = BaseTest UnitTest "unitTest" Nothing defaultTestOptions (return ())+      wrappedUnitTest = wrap wrapper unitTest+      wrapper test = HU.assertFailure "Fail" >> test++wrappableTests = [("testWrapCanCauseFailure", testWrapCanCauseFailure)]
Test/Framework/TestTypes.hs view
@@ -205,6 +205,7 @@       , tc_timeoutIsSuccess :: Bool     -- ^ Do not regard timeout as an error       , tc_maxSingleTestTime :: Maybe Milliseconds -- ^ Maximum time in milliseconds a single test is allowed to run       , tc_prevFactor :: Maybe Double   -- ^ Maximum factor a single test is allowed to run slower than its previous execution+      , tc_repeat :: Int                -- ^ Number of times to repeat tests selected on the command line before reporting them as a success.       }  instance Show TestConfig where@@ -226,6 +227,7 @@         showString ", tc_timeoutIsSuccess=" . showsPrec 1 (tc_timeoutIsSuccess tc) .         showString ", tc_maxSingleTestTime=" . showsPrec 1 (tc_maxSingleTestTime tc) .         showString ", tc_prevFactor=" . showsPrec 1 (tc_prevFactor tc) .+        showString ", tc_repeat=" . showsPrec 1 (tc_repeat tc) .         showString " }"  -- | A 'TestReporter' provides hooks to customize the output of HTF.
Test/Framework/ThreadPool.hs view
@@ -184,7 +184,7 @@  runTestParallel :: Int -> Int -> IO () runTestParallel nEntries n =-    do putStrLn ("Running test " ++ show n)+    do debug ("Running test " ++ show n)        boxes <- mapM (\i -> do mvar <- newEmptyNamedMVar ("testbox" ++ show i)                                return (mvar, i))                       [1..nEntries]@@ -193,7 +193,7 @@        debug ("Checking boxes in test " ++ show n)        --runSequentially entries        mapM_ assertBox boxes-       putStrLn ("Test " ++ show n ++ " successful")+       debug ("Test " ++ show n ++ " successful")     where       mkEntry (mvar, i) =           let pre = myThreadId
− run-all-tests-for-all-compilers.sh
@@ -1,40 +0,0 @@-#!/bin/bash--compilers=$(gawk -F == '/GHC==/ {print $2}' HTF.cabal  | tr -d ,)--for x in $compilers-do-    switch-ghc $x > /dev/null-    ghc_version=$(ghc --version | sed -E 's/.*version ([.0-9]*)/\1/g')-    if [ "$x" != "$ghc_version" ]-    then-        echo "Could not switch to GHC version $x as requested, version is now $ghc_version"-        exit 1-    fi-    echo-    echo-    echo "============================================================"-    echo "============================================================"-    echo "==> Running tests for GHC version $ghc_version <=="-    echo "==> Running tests for GHC version $ghc_version <=="-    echo "==> Running tests for GHC version $ghc_version <=="-    echo "============================================================"-    echo "============================================================"-    echo-    ./run-all-tests.sh-    ecode=$?-    if [ $ecode -eq 0 ]-    then-        result="ok"-    else-        result="FAIL"-    fi-    RESULT="$RESULT\nResult for GHC version $ghc_version: $result"-    if [ $ecode -ne 0 ]-    then-        exit 1-    fi-done--echo-echo -e $RESULT
− run-all-tests.sh
@@ -1,36 +0,0 @@-#!/bin/bash--SANDBOX_FILE="cabal.sandbox.config"-SANDBOX_DIR=".cabal-sandbox"-CABAL=$HOME/bin/cabal-with-cpphs--if [ ! -x "$CABAL" ]; then-    CABAL=cabal-fi--set -e-if [ -e "$SANDBOX_FILE"  ]-then-    have_sandbox=yes-    cabal sandbox hc-pkg unregister HTF || true-else-    have_sandbox=no-    ghc-pkg unregister HTF || true-fi--$CABAL configure --enable-tests || exit 1-$CABAL build || exit 1-$CABAL test || exit 1-$CABAL install || exit 1--cd sample || exit 1--if [ "$have_sandbox" == "yes" ]-then-    rm -f cabal.sandbox.config-    cabal sandbox init --sandbox ../"$SANDBOX_DIR"-fi--$CABAL configure --enable-tests || exit 1-$CABAL build || exit 1-$CABAL test || exit 1
sample/TestMain.hs view
@@ -9,5 +9,5 @@ import {-@ HTF_TESTS @-} MyPkg.B  main =-    do bbts <- blackBoxTests "bbt-dir" "dist/build/sample/sample" ".num" defaultBBTArgs+    do bbts <- blackBoxTests "bbt-dir" "../scripts/run-sample" ".num" defaultBBTArgs        htfMain (htf_importedTests ++ [makeTestSuite "bbts" bbts])
sample/sample-HTF.cabal view
@@ -1,6 +1,7 @@ name:                sample-HTF version:             0.1.0.0 synopsis:            Sample project showing how to use HTF+description:         Sample project showing how to use HTF homepage:            https://github.com/skogsbaer/HTF/ license:             BSD3 license-file:        LICENSE@@ -13,12 +14,12 @@ executable sample   main-is:           Main.hs   other-modules:     MyPkg.A MyPkg.B-  build-depends:     base, HTF == 0.13.*+  build-depends:     base == 4.*, HTF == 0.13.*   default-language:  Haskell2010  test-suite sample-tests   type:              exitcode-stdio-1.0   main-is:           TestMain.hs   other-modules:     MyPkg.A MyPkg.B-  build-depends:     base, HTF == 0.13.*+  build-depends:     base == 4.*, HTF == 0.13.*   default-language:  Haskell2010
+ scripts/local-htfpp view
@@ -0,0 +1,11 @@+#!/bin/bash++TOP=$(cd $(dirname ${BASH_SOURCE[0]})/.. > /dev/null && pwd -P)+d=$(stack $HTF_TRAVIS_STACK_ARGS path --dist-dir)+bin="$TOP/$d/build/htfpp/htfpp"++if [ ! -x "$bin" ]; then+    echo "No executable found at $bin" >&2+    exit 1+fi+"$bin" "$@"
+ scripts/run-sample view
@@ -0,0 +1,3 @@+#!/bin/bash++stack exec sample -- "$@"
tests/Foo/A.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-} {-# LANGUAGE CPP #-}  module Foo.A where
tests/Foo/B.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-}  module Foo.B (htf_thisModulesTests) where 
tests/MiscTest.hs view
@@ -21,10 +21,11 @@ import Test.Framework.Preprocessor import Test.Framework.PrettyHaskell import Test.Framework.HUnitWrapper+import Test.Framework.TestManager import System.Exit import Test.HUnit -allTests = historyTests ++ preprocessorTests ++ prettyHaskellTests ++ hunitWrapperTests+allTests = historyTests ++ preprocessorTests ++ prettyHaskellTests ++ hunitWrapperTests ++ wrappableTests  main :: IO () main =
tests/TestHTF.hs view
@@ -5,7 +5,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE QuasiQuotes #-}-{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-} -- -- Copyright (c) 2005,2010   Stefan Wehr - http://www.stefanwehr.de --@@ -61,6 +61,7 @@ import UniqTests1 import UniqTests2 import PrevFactor+import Repeat import SortByPrevTime import Quasi @@ -298,7 +299,7 @@                                                                                       ,"line" .= J.toJSON (97+lineOffset)]]]])     where       lineOffset :: Int-      lineOffset = 31+      lineOffset = 32       checkStatus tuple@(pass, fail, error, pending, timedOut) json =           {-             {"location":null@@ -381,13 +382,13 @@           T.unpack $           T.decodeUtf8With T.lenientDecode $           BSL.toStrict $-          J.encodePretty' (J.Config 2 J.compare) json+          J.encodePretty' J.defConfig json  runRealBlackBoxTests =     do b <- doesDirectoryExist "tests/bbt"        let dirPrefix = if b then "tests" else ""        bbts <- blackBoxTests (dirPrefix </> "real-bbt") ("/bin/bash") ".sh"-                 (defaultBBTArgs { bbtArgs_verbose = False })+                 (defaultBBTArgs { bbtArgs_verbose = True })        ecode <- runTest bbts        case ecode of          ExitFailure _ -> fail ("real blackbox tests failed!")@@ -401,7 +402,7 @@                  (defaultBBTArgs { bbtArgs_verbose = False })        let tests = [addToTestSuite htf_thisModulesTests bbts] ++ htf_importedTests        when ("--help" `elem` args || "-h" `elem` args) $-            do hPutStrLn stderr ("USAGE: dist/build/test/test [--direct]")+            do hPutStrLn stderr ("USAGE: PROG [--direct]")                ecode <- runTestWithArgs ["--help"] ([] :: [Test])                exitWith ecode        case args of@@ -409,6 +410,7 @@          "MaxCurTime.hs":rest -> maxCurTimeMain rest          "MaxPrevTime.hs":rest -> maxPrevTimeMain rest          "PrevFactor.hs":rest -> prevFactorMain rest+         "Repeat.hs":rest -> repeatMain rest          "SortByPrevTime.hs":rest -> sortByPrevTimeMain rest          "UniqTests1.hs":rest -> uniqTests1Main rest          "UniqTests2.hs":rest -> uniqTests2Main rest@@ -421,7 +423,7 @@          _ ->              do withSystemTempFile "HTF-out" $ \outFile h ->                   do hClose h-                     ecode <- runTestWithArgs ["-j4", "--deterministic",+                     ecode <- runTestWithArgs ["-j4", "--shuffle=false",                                                "--json", "--output-file=" ++ outFile] tests                      case ecode of                        ExitFailure _ -> checkOutput outFile
tests/TestHTFHunitBackwardsCompatible.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp -optF --hunit #-}+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp -optF --hunit #-} module TestHTFHunitBackwardsCompatible where  import Test.Framework
tests/Tutorial.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-} module Tutorial where  import System.Environment ( getArgs )
tests/compile-errors/Test1.hs view
@@ -1,6 +1,6 @@-{-# OPTIONS_GHC -F -pgmF ../../dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ../../scripts/local-htfpp #-} -import Test.Framework+import "HTF" Test.Framework #include "Foo.h"  foo :: Int -> Int
tests/compile-errors/Test2.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-}-{-# OPTIONS_GHC -F -pgmF ../../dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ../../scripts/local-htfpp #-} -import Test.Framework+import "HTF" Test.Framework #include "Foo.h" foo :: Int -> Int foo i = i + "Stefan"
tests/compile-errors/Test3.hs view
@@ -1,6 +1,6 @@-{-# OPTIONS_GHC -F -pgmF ../../dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ../../scripts/local-htfpp #-} -import Test.Framework+import "HTF" Test.Framework  -- error must be in line 7 test_foo :: Int
tests/compile-errors/Test4.hs view
@@ -1,6 +1,6 @@-{-# OPTIONS_GHC -F -pgmF ../../dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ../../scripts/local-htfpp #-} -import Test.Framework+import "HTF" Test.Framework data D = D -- error must be in line 7 prop_foo :: D -> Bool
tests/compile-errors/run-tests.sh view
@@ -2,30 +2,20 @@  cd "$(dirname $0)" -FLAGS="-hide-all-packages -package base -package-db ../../dist/package.conf.inplace -package HTF --make"-SANDBOX_FILE="../../cabal.sandbox.config"-SANDBOX_DIR="../../.cabal-sandbox"-GHC_VERSION=$(ghc --version | sed 's/.*version //g')--if [ -e "$SANDBOX_FILE"  ]-then-    for pkg_db in $(ls -d -1 $SANDBOX_DIR/*$GHC_VERSION*-packages.conf.d)-    do-        FLAGS="$FLAGS -package-db $pkg_db"-    done-fi-echo $FLAGS- lineno=7 function check() {     test="$1"-    ghc $FLAGS "$test" 2>&1 | grep "$test":$lineno+    command -v grep >/dev/null 2>&1 || \+        { echo >&2 "Test $0 requires ``grep'' but it's not installed.  Aborting."; exit 1; }+    compile_cmd="stack $HTF_TRAVIS_STACK_ARGS ghc -- -XPackageImports $test"+    $compile_cmd 2>&1 | grep "$test":$lineno     grep_ecode=${PIPESTATUS[1]}     if [ "$grep_ecode" != "0" ]     then         echo "Compile error for $test did not occur in line $lineno, exit code of grep: ${grep_ecode}"-        ghc $FLAGS "$test"+        echo "Here is the output of the compiler:"+        $compile_cmd         exit 1     fi }
tests/real-bbt/FailFast.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-} module FailFast (failFastMain) where  import Test.Framework
tests/real-bbt/MaxCurTime.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF scripts/local-htfpp #-} module MaxCurTime (maxCurTimeMain) where  import Test.Framework
tests/real-bbt/MaxPrevTime.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF scripts/local-htfpp #-} module MaxPrevTime (maxPrevTimeMain) where  import Test.Framework
tests/real-bbt/PrevFactor.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF scripts/local-htfpp #-} module PrevFactor (prevFactorMain) where  import Test.Framework
+ tests/real-bbt/Repeat.hs view
@@ -0,0 +1,23 @@+{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-}+module Repeat (repeatMain) where++import Test.Framework++import Data.IORef+import System.IO.Unsafe++globalBool :: IORef Bool+globalBool = unsafePerformIO (newIORef True)+{-# NOINLINE globalBool #-}++readGlobalBool ::  IO Bool+readGlobalBool =+    do b <- readIORef globalBool+       writeIORef globalBool False+       return b++test_globalMVarIsTrue =+    do b <- readGlobalBool+       assertEqual b True++repeatMain args = htfMainWithArgs args htf_thisModulesTests
tests/real-bbt/SortByPrevTime.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF scripts/local-htfpp #-} module SortByPrevTime (sortByPrevTimeMain) where  import Test.Framework
tests/real-bbt/UniqTests1.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF scripts/local-htfpp #-} module UniqTests1 (uniqTests1Main) where  import Test.Framework
tests/real-bbt/UniqTests2.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE LambdaCase #-}-{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-}+{-# OPTIONS_GHC -F -pgmF scripts/local-htfpp #-} module UniqTests2 (uniqTests2Main) where  import Test.Framework