-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Please see the README at -- https://github.com/jwoudenberg/junit-xml. @package junit-xml @version 0.1.0.4 -- | A module for producing JUnit style XML reports, for consumption by CI -- platforms like Jenkins. Please see the README at -- https://github.com/jwoudenberg/junit-xml. module Text.XML.JUnit -- | This function writes an xml report to the provided path. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ passed "A passing test"
--         & inSuite "Test suite"
--     , failed "A failing test"
--         & inSuite "Test suite"
--     ]
--   
writeXmlReport :: FilePath -> [TestSuite] -> IO () -- | Create a report for a passing test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ passed "A passing test"
--         & stdout "Test ran succesfully!"
--         & stderr "Warning: don't overcook the vegetables!"
--         & time 0.003
--         & inSuite "Test suite"
--     ]
--   
passed :: Text -> TestReport Passed -- | Create a report for a skipped test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ skipped "A skipped test"
--         & inSuite "Test suite"
--     ]
--   
skipped :: Text -> TestReport Skipped -- | Create a report for a failed test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ failed "A failing test"
--         & stdout "Running test..."
--         & stderr "Test failed: expected 3 slices of pizza but got one."
--         & failureMessage "Not enough pizza"
--         & failureStackTrace ["pizza", "pizzeria", "italy"]
--         & time 0.08
--         & inSuite "Test suite"
--     ]
--   
failed :: Text -> TestReport Failed -- | Create a report for a test that threw an error. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ errored "A test that threw an error"
--         & stdout "Running test..."
--         & stderr "Unexpected exception: BedTime"
--         & errorMessage "Operation canceled due to BedTimeOut"
--         & errorStackTrace ["bed", "sleep", "night"]
--         & time 0.08
--         & inSuite "Test suite"
--     ]
--   
errored :: Text -> TestReport Errored -- | Wrap a test report in a suite, allowing it to be added to the list of -- reports passed to writeXmlReports. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ passed "Passed test"
--         & inSuite "Some test suite"
--     ]
--   
inSuite :: Text -> TestReport outcome -> TestSuite -- | Add the stdout produced running a test to the report for that test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ passed "A passing test"
--         & stdout "Test ran succesfully!"
--         & inSuite "Test suite"
--     ]
--   
stdout :: Text -> TestReport outcome -> TestReport outcome -- | Add the stderr produced running a test to the report for that test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ failed "A failing test"
--         & stderr "Expected 4, but got 2."
--         & inSuite "Test suite"
--     ]
--   
stderr :: Text -> TestReport outcome -> TestReport outcome -- | Add the running time of a test to the report for that test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ passed "A passing test"
--         & time 0.003
--         & inSuite "Test suite"
--     ]
--   
time :: Double -> TestReport outcome -> TestReport outcome -- | Add an error message to the report of a failed test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ failed "A failing test"
--         & failureMessage "Laundromat exceeds noise tolerance."
--         & inSuite "Test suite"
--     ]
--   
failureMessage :: Text -> TestReport Failed -> TestReport Failed -- | Add a stack trace to the report of a failed test. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ failed "A failing test"
--         & failureStackTrace ["ankleClass", "legClass", "limbClass"]
--         & inSuite "Test suite"
--     ]
--   
failureStackTrace :: [Text] -> TestReport Failed -> TestReport Failed -- | Add an error message to the report for a test that threw an exception. -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ errored "A test that threw an error"
--         & errorMessage "Too much Netflix"
--         & inSuite "Test suite"
--     ]
--   
errorMessage :: Text -> TestReport Errored -> TestReport Errored -- | Add a stack trace to a report for a test that threw an exception -- --
--   import Data.Function ((&))
--   
--   writeXmlReport "report.xml"
--     [ errored "A test that threw an error"
--         & errorStackTrace ["at closeCurtain line 3", "at goToSleep line 8"]
--         & inSuite "Test suite"
--     ]
--   
errorStackTrace :: [Text] -> TestReport Errored -> TestReport Errored -- | The report for a single test case. data TestReport outcome -- | A test report annotated with the test suite it is part of. data TestSuite instance Text.XML.JUnit.Outcome Text.XML.JUnit.Passed instance Text.XML.JUnit.Outcome Text.XML.JUnit.Skipped instance Text.XML.JUnit.Outcome Text.XML.JUnit.Failed instance Text.XML.JUnit.Outcome Text.XML.JUnit.Errored instance GHC.Base.Semigroup Text.XML.JUnit.Counts instance GHC.Base.Monoid Text.XML.JUnit.Counts