summaryrefslogtreecommitdiff
path: root/erebos-tester.cabal
blob: c3a49e6f4d87e24ca369f8eb5683c6ebbd256c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
cabal-version:       3.0

name:                erebos-tester
version:             0.2.4
synopsis:            Test framework with virtual network using Linux namespaces
description:
    This framework is intended mainly for networking libraries/applications and
    can run multiple concurrent instances of the tested application on
    different nodes, possibly within separate subnets, on the virtual network.
    Each instance can receive its own commands and produce output to be checked
    via standard input/output, as defined using custom script language.
homepage:            https://erebosprotocol.net/tester
-- bug-reports:
license:             GPL-3.0-only
license-file:        LICENSE
author:              Roman Smrž
maintainer:          roman.smrz@seznam.cz
-- copyright:
category:            Testing
extra-doc-files:
    README.md
    CHANGELOG.md

flag ci
    description:    Options for CI testing
    default: False
    manual: True

source-repository head
    type:       git
    location:   git://erebosprotocol.net/tester

common common
    ghc-options:
        -Wall
        -fdefer-typed-holes

    if flag(ci)
        ghc-options:
            -Werror
            -- sometimes needed for backward/forward compatibility:
            -Wno-error=unused-imports

  build-depends:
        base             ^>= { 4.15, 4.16, 4.17, 4.18, 4.19, 4.20 },

executable erebos-tester
  import: common
  ghc-options:
        -- disable interval timer to avoid spawing thread that breaks unshare(CLONE_NEWUSER)
        -with-rtsopts=-V0
  if impl(ghc >= 9.8)
        ghc-options:
            -- no multithreading is allowed for unshare(CLONE_NEWUSER)
            -single-threaded

  main-is:             Wrapper.hs
  -- other-modules:
  -- other-extensions:
  build-depends:
        directory        >=1.3 && <1.4,
        filepath        ^>= { 1.4.2.1, 1.5.2 },
        linux-namespaces^>=0.1.3,
        process         ^>=1.6.9,
        unix             >=2.7 && <2.9,
  hs-source-dirs:      src
  default-language:    Haskell2010

executable erebos-tester-core
  import: common
  ghc-options:
        -threaded

  main-is:             Main.hs

  other-modules:       Config
                       GDB
                       Network
                       Network.Ip
                       Output
                       Parser
                       Parser.Core
                       Parser.Expr
                       Parser.Statement
                       Paths_erebos_tester
                       Process
                       Run
                       Run.Monad
                       Test
                       Test.Builtins
                       Util
                       Version
                       Version.Git

  autogen-modules:     Paths_erebos_tester

  other-extensions:    TemplateHaskell
  default-extensions:  ExistentialQuantification
                       FlexibleContexts
                       FlexibleInstances
                       GADTs
                       GeneralizedNewtypeDeriving
                       ImportQualifiedPost
                       LambdaCase
                       MultiParamTypeClasses
                       MultiWayIf
                       OverloadedStrings
                       RankNTypes
                       RecordWildCards
                       ScopedTypeVariables
                       TupleSections
                       TypeApplications
                       TypeFamilies
                       TypeOperators
  build-depends:
        bytestring      ^>= { 0.10, 0.11, 0.12 },
        containers      ^>= { 0.6.2.1, 0.7 },
        directory       ^>=1.3.6.0,
        filepath        ^>= { 1.4.2.1, 1.5.2 },
        Glob             >=0.10 && <0.11,
        haskeline        >=0.8 && <0.9,
        HsYAML           >=0.2 && <0.3,
        megaparsec       >=9.0 && <10,
        mtl              >=2.2 && <2.4,
        parser-combinators      >=1.3 && <1.4,
        process         ^>=1.6.9,
        regex-tdfa      ^>=1.3.1.0,
        scientific       >=0.3 && < 0.4,
        stm             ^>=2.5.0.1,
        template-haskell^>= { 2.17, 2.18, 2.19, 2.20, 2.21, 2.22 },
        text            ^>= { 1.2, 2.0, 2.1 },
        th-compat        >=0.1 && <0.2,
        unix             >=2.7 && <2.9,
  hs-source-dirs:      src
  default-language:    Haskell2010