#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GLib.Structs.TestSuite
(
TestSuite(..) ,
noTestSuite ,
#if ENABLE_OVERLOADING
TestSuiteAddMethodInfo ,
#endif
testSuiteAdd ,
#if ENABLE_OVERLOADING
TestSuiteAddSuiteMethodInfo ,
#endif
testSuiteAddSuite ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.GLib.Structs.TestCase as GLib.TestCase
newtype TestSuite = TestSuite (ManagedPtr TestSuite)
instance WrappedPtr TestSuite where
wrappedPtrCalloc = return nullPtr
wrappedPtrCopy = return
wrappedPtrFree = Nothing
noTestSuite :: Maybe TestSuite
noTestSuite = Nothing
#if ENABLE_OVERLOADING
instance O.HasAttributeList TestSuite
type instance O.AttributeList TestSuite = TestSuiteAttributeList
type TestSuiteAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_test_suite_add" g_test_suite_add ::
Ptr TestSuite ->
Ptr GLib.TestCase.TestCase ->
IO ()
testSuiteAdd ::
(B.CallStack.HasCallStack, MonadIO m) =>
TestSuite
-> GLib.TestCase.TestCase
-> m ()
testSuiteAdd suite testCase = liftIO $ do
suite' <- unsafeManagedPtrGetPtr suite
testCase' <- unsafeManagedPtrGetPtr testCase
g_test_suite_add suite' testCase'
touchManagedPtr suite
touchManagedPtr testCase
return ()
#if ENABLE_OVERLOADING
data TestSuiteAddMethodInfo
instance (signature ~ (GLib.TestCase.TestCase -> m ()), MonadIO m) => O.MethodInfo TestSuiteAddMethodInfo TestSuite signature where
overloadedMethod _ = testSuiteAdd
#endif
foreign import ccall "g_test_suite_add_suite" g_test_suite_add_suite ::
Ptr TestSuite ->
Ptr TestSuite ->
IO ()
testSuiteAddSuite ::
(B.CallStack.HasCallStack, MonadIO m) =>
TestSuite
-> TestSuite
-> m ()
testSuiteAddSuite suite nestedsuite = liftIO $ do
suite' <- unsafeManagedPtrGetPtr suite
nestedsuite' <- unsafeManagedPtrGetPtr nestedsuite
g_test_suite_add_suite suite' nestedsuite'
touchManagedPtr suite
touchManagedPtr nestedsuite
return ()
#if ENABLE_OVERLOADING
data TestSuiteAddSuiteMethodInfo
instance (signature ~ (TestSuite -> m ()), MonadIO m) => O.MethodInfo TestSuiteAddSuiteMethodInfo TestSuite signature where
overloadedMethod _ = testSuiteAddSuite
#endif
#if ENABLE_OVERLOADING
type family ResolveTestSuiteMethod (t :: Symbol) (o :: *) :: * where
ResolveTestSuiteMethod "add" o = TestSuiteAddMethodInfo
ResolveTestSuiteMethod "addSuite" o = TestSuiteAddSuiteMethodInfo
ResolveTestSuiteMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTestSuiteMethod t TestSuite, O.MethodInfo info TestSuite p) => OL.IsLabel t (TestSuite -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif