Skip to content

Commit 556d1e6

Browse files
cydparsermergify[bot]
authored andcommitted
Fix optional test-suite/benchmark type docs
1 parent 1209433 commit 556d1e6

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

doc/cabal-package.rst

+20-3
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ look something like this:
933933
default-language: Haskell2010
934934

935935
test-suite test-foo
936+
type: exitcode-stdio-1.0
936937
main-is: test-foo.hs
937938
-- NOTE: no constraints on 'foo-internal' as same-package
938939
-- dependencies implicitly refer to the same package instance
@@ -1206,14 +1207,14 @@ Test suites
12061207
The test suite may be described using the following fields, as well as
12071208
build information fields (see the section on `build information`_).
12081209

1209-
.. pkg-field:: type: interface
1210+
.. pkg-field:: type: interface (required until ``cabal-version`` 3.8)
12101211

12111212
The interface type and version of the test suite. Cabal supports two
1212-
test suite interfaces, called ``exitcode-stdio-1.0`` (default) and
1213+
test suite interfaces, called ``exitcode-stdio-1.0`` (default since ``cabal-version`` 3.8) and
12131214
``detailed-0.9``. Each of these types may require or disallow other
12141215
fields as described below.
12151216

1216-
Test suites using the ``exitcode-stdio-1.0`` (default) interface are executables
1217+
Test suites using the ``exitcode-stdio-1.0`` (default since ``cabal-version`` 3.8) interface are executables
12171218
that indicate test failure with a non-zero exit code when run; they may
12181219
provide human-readable log information through the standard output and
12191220
error channels. The ``exitcode-stdio-1.0`` type requires the ``main-is``
@@ -1222,6 +1223,7 @@ field.
12221223
.. pkg-field:: main-is: filename
12231224
:synopsis: Module containing tests main function.
12241225

1226+
:required: ``exitcode-stdio-1.0``
12251227
:disallowed: ``detailed-0.9``
12261228

12271229
The name of the ``.hs`` or ``.lhs`` file containing the ``Main``
@@ -1243,6 +1245,7 @@ the :pkg-field:`test-module` field.
12431245

12441246
.. pkg-field:: test-module: identifier
12451247

1248+
:required: ``detailed-0.9``
12461249
:disallowed: ``exitcode-stdio-1.0``
12471250

12481251
The module exporting the ``tests`` symbol.
@@ -1263,6 +1266,7 @@ demonstrate the use of the ``exitcode-stdio-1.0`` interface.
12631266
Build-Type: Simple
12641267
12651268
Test-Suite test-foo
1269+
type: exitcode-stdio-1.0
12661270
main-is: test-foo.hs
12671271
build-depends: base >= 4 && < 5
12681272
default-language: Haskell2010
@@ -1297,6 +1301,7 @@ be provided by the library that provides the testing facility.
12971301
Build-Type: Simple
12981302
12991303
Test-Suite test-bar
1304+
type: detailed-0.9
13001305
test-module: Bar
13011306
build-depends: base >= 4 && < 5, Cabal >= 1.9.2 && < 2
13021307
default-language: Haskell2010
@@ -1359,6 +1364,16 @@ Benchmarks
13591364
The benchmark may be described using the following fields, as well as
13601365
build information fields (see the section on `build information`_).
13611366

1367+
.. pkg-field:: type: interface (required until ``cabal-version`` 3.8)
1368+
1369+
The interface type and version of the benchmark. At the moment Cabal
1370+
only support one benchmark interface, called ``exitcode-stdio-1.0``.
1371+
1372+
Benchmarks using the ``exitcode-stdio-1.0`` (default since ``cabal-version`` 3.8) interface are executables
1373+
that indicate failure to run the benchmark with a non-zero exit code
1374+
when run; they may provide human-readable information through the
1375+
standard output and error channels.
1376+
13621377
.. pkg-field:: main-is: filename
13631378

13641379
The name of the ``.hs`` or ``.lhs`` file containing the ``Main``
@@ -1383,6 +1398,7 @@ Example:
13831398
Build-Type: Simple
13841399
13851400
Benchmark bench-foo
1401+
type: exitcode-stdio-1.0
13861402
main-is: bench-foo.hs
13871403
build-depends: base >= 4 && < 5, time >= 1.1 && < 1.7
13881404
default-language: Haskell2010
@@ -2717,6 +2733,7 @@ Starting with Cabal-2.2 it's possible to use common build info stanzas.
27172733

27182734
test-suite tests
27192735
import: deps, test-deps
2736+
type: exitcode-stdio-1.0
27202737
main-is: Tests.hs
27212738
build-depends: foo
27222739
default-language: Haskell2010

0 commit comments

Comments
 (0)