packages feed

mqtt-0.1.0.0: mqtt.cabal

name:                mqtt
synopsis:            An MQTT protocol implementation.
description:
  This project aims to supply a rock-solid MQTT implementation suitable for
  production use.
version:             0.1.0.0
license:             MIT
license-file:        LICENSE
author:              Lars Petersen
maintainer:          info@lars-petersen.net
category:            Network, IoT
homepage:            https://github.com/lpeterse/haskell-mqtt
bug-reports:         https://github.com/lpeterse/haskell-mqtt/issues
extra-source-files:  README.md
build-type:          Simple
cabal-version:       >=1.10

source-repository head
  type:     git
  location: git://github.com/lpeterse/haskell-mqtt.git

library
  ghc-options:         -Wall
  exposed-modules:     Network.Stack.Server,
                       Network.MQTT.Client,
                       Network.MQTT.Message,
                       Network.MQTT.Trie,
                       Network.MQTT.Broker,
                       Network.MQTT.Broker.Authentication,
                       Network.MQTT.Broker.RetainedMessages,
                       Network.MQTT.Broker.Server,
                       Network.MQTT.Broker.Session,
                       Network.MQTT.Broker.SessionStatistics
  other-modules:       Control.Concurrent.PrioritySemaphore,
                       Network.MQTT.Message.QoS,
                       Network.MQTT.Message.Topic,
                       Network.MQTT.Broker.Internal
  build-depends:       async,
                       attoparsec,
                       base >=4.8 && <5,
                       bytestring,
                       clock,
                       binary,
                       exceptions,
                       text,
                       containers,
                       socket,
                       tls,
                       uuid,
                       case-insensitive,
                       x509,
                       x509-validation,
                       websockets,
                       hslogger
  hs-source-dirs:      src
  default-language:    Haskell2010

benchmark topic-matching
  type:             exitcode-stdio-1.0
  ghc-options:      -Wall -O2
  default-language: Haskell2010
  hs-source-dirs:   benchmark
  main-is:          TopicMatching.hs
  build-depends:
    base,
    bytestring,
    binary,
    criterion,
    mqtt,
    text

benchmark binary
  type:
    exitcode-stdio-1.0
  default-language:
    Haskell2010
  ghc-options:
    -Wall -threaded
  hs-source-dirs:
    benchmark
  main-is:
    Binary.hs
  build-depends:
    base,
    bytestring,
    binary,
    criterion,
    mqtt,
    text

test-suite test
  type:
    exitcode-stdio-1.0
  default-language:
    Haskell2010
  ghc-options:
    -Wall -fno-warn-orphans
  hs-source-dirs:
    test
  main-is:
    Main.hs
  other-modules:
    BrokerTest,
    EncodingTest,
    TrieTest,
    TopicTest
  build-depends:
      async
    , base >= 4.8 && < 5
    , binary
    , tasty >= 0.11
    , tasty-hunit
    , tasty-quickcheck
    , bytestring
    , attoparsec
    , exceptions
    , mqtt
    , text
    , tls
    , network-uri
    , deepseq
    , containers
    , uuid

test-suite priority-semaphore
  type:
    exitcode-stdio-1.0
  default-language:
    Haskell2010
  ghc-options:
    -Wall
  hs-source-dirs:
    src,
    test
  main-is:
    PrioritySemaphoreTest.hs
  other-modules:
    Control.Concurrent.PrioritySemaphore
  build-depends:
      async
    , base >= 4.8 && < 5
    , tasty >= 0.11
    , tasty-hunit
    , tasty-quickcheck
    , mqtt

-- This test suite runs with restricted maximum heap size.
-- A memory leak would result in heap usage of more than 4MB
-- leading to test failure.
test-suite retained-store-strictness-test
  type:
    exitcode-stdio-1.0
  default-language:
    Haskell2010
  ghc-options:
    -Wall "-with-rtsopts=-M4m"
  main-is:
    test/RetainedStoreStrictnessTest.hs
  build-depends:
    base >= 4.8 && <5,
    mqtt

-- This test suite runs with restricted maximum heap size.
-- The routing tree with 1 million nodes and around 3 subscriptions per node
-- took 83MB when measured.
-- We allow for some deviation, but it should not exceed 100MB heap space.
test-suite routing-tree-size-test
  type:
    exitcode-stdio-1.0
  default-language:
    Haskell2010
  ghc-options:
    -Wall "-with-rtsopts=-M100m -s"
  main-is:
    test/TrieSizeTest.hs
  build-depends:
    base >= 4.8 && <5,
    containers,
    mqtt,
    random