module Test.Hspec.JUnit.Schema
  ( Suites(..)
  , Suite(..)
  , TestCase(..)
  , Location(..)
  , Result(..)
  ) where

import Prelude

import Data.Text (Text)
import Data.Time (UTCTime)
import Numeric.Natural

data Suites = Suites
  { Suites -> Text
suitesName :: Text
  , Suites -> [Suite]
suitesSuites :: [Suite]
  }
  deriving stock Int -> Suites -> ShowS
[Suites] -> ShowS
Suites -> String
(Int -> Suites -> ShowS)
-> (Suites -> String) -> ([Suites] -> ShowS) -> Show Suites
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Suites] -> ShowS
$cshowList :: [Suites] -> ShowS
show :: Suites -> String
$cshow :: Suites -> String
showsPrec :: Int -> Suites -> ShowS
$cshowsPrec :: Int -> Suites -> ShowS
Show

data Suite = Suite
  { Suite -> Text
suiteName :: Text
  , Suite -> UTCTime
suiteTimestamp :: UTCTime
  , Suite -> [TestCase]
suiteCases :: [TestCase]
  }
  deriving stock Int -> Suite -> ShowS
[Suite] -> ShowS
Suite -> String
(Int -> Suite -> ShowS)
-> (Suite -> String) -> ([Suite] -> ShowS) -> Show Suite
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Suite] -> ShowS
$cshowList :: [Suite] -> ShowS
show :: Suite -> String
$cshow :: Suite -> String
showsPrec :: Int -> Suite -> ShowS
$cshowsPrec :: Int -> Suite -> ShowS
Show

data TestCase = TestCase
  { TestCase -> Maybe Location
testCaseLocation :: Maybe Location
  , TestCase -> Text
testCaseClassName :: Text
  , TestCase -> Text
testCaseName :: Text
  , TestCase -> Double
testCaseDuration :: Double
  , TestCase -> Maybe Result
testCaseResult :: Maybe Result
  }
  deriving stock Int -> TestCase -> ShowS
[TestCase] -> ShowS
TestCase -> String
(Int -> TestCase -> ShowS)
-> (TestCase -> String) -> ([TestCase] -> ShowS) -> Show TestCase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestCase] -> ShowS
$cshowList :: [TestCase] -> ShowS
show :: TestCase -> String
$cshow :: TestCase -> String
showsPrec :: Int -> TestCase -> ShowS
$cshowsPrec :: Int -> TestCase -> ShowS
Show

data Location = Location
  { Location -> String
locationFile :: FilePath
  , Location -> Natural
locationLine :: Natural
  }
  deriving stock Int -> Location -> ShowS
[Location] -> ShowS
Location -> String
(Int -> Location -> ShowS)
-> (Location -> String) -> ([Location] -> ShowS) -> Show Location
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Location] -> ShowS
$cshowList :: [Location] -> ShowS
show :: Location -> String
$cshow :: Location -> String
showsPrec :: Int -> Location -> ShowS
$cshowsPrec :: Int -> Location -> ShowS
Show

data Result = Failure Text Text | Skipped Text
  deriving stock Int -> Result -> ShowS
[Result] -> ShowS
Result -> String
(Int -> Result -> ShowS)
-> (Result -> String) -> ([Result] -> ShowS) -> Show Result
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Result] -> ShowS
$cshowList :: [Result] -> ShowS
show :: Result -> String
$cshow :: Result -> String
showsPrec :: Int -> Result -> ShowS
$cshowsPrec :: Int -> Result -> ShowS
Show