Skip to content

Commit efd3f4f

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

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
@@ -926,6 +926,7 @@ look something like this:
926926
default-language: Haskell2010
927927

928928
test-suite test-foo
929+
type: exitcode-stdio-1.0
929930
main-is: test-foo.hs
930931
-- NOTE: no constraints on 'foo-internal' as same-package
931932
-- dependencies implicitly refer to the same package instance
@@ -1187,14 +1188,14 @@ Test suites
11871188
The test suite may be described using the following fields, as well as
11881189
build information fields (see the section on `build information`_).
11891190

1190-
.. pkg-field:: type: interface
1191+
.. pkg-field:: type: interface (required until ``cabal-version`` 3.8)
11911192

11921193
The interface type and version of the test suite. Cabal supports two
1193-
test suite interfaces, called ``exitcode-stdio-1.0`` (default) and
1194+
test suite interfaces, called ``exitcode-stdio-1.0`` (default since ``cabal-version`` 3.8) and
11941195
``detailed-0.9``. Each of these types may require or disallow other
11951196
fields as described below.
11961197

1197-
Test suites using the ``exitcode-stdio-1.0`` (default) interface are executables
1198+
Test suites using the ``exitcode-stdio-1.0`` (default since ``cabal-version`` 3.8) interface are executables
11981199
that indicate test failure with a non-zero exit code when run; they may
11991200
provide human-readable log information through the standard output and
12001201
error channels. The ``exitcode-stdio-1.0`` type requires the ``main-is``
@@ -1203,6 +1204,7 @@ field.
12031204
.. pkg-field:: main-is: filename
12041205
:synopsis: Module containing tests main function.
12051206

1207+
:required: ``exitcode-stdio-1.0``
12061208
:disallowed: ``detailed-0.9``
12071209

12081210
The name of the ``.hs`` or ``.lhs`` file containing the ``Main``
@@ -1224,6 +1226,7 @@ the :pkg-field:`test-module` field.
12241226

12251227
.. pkg-field:: test-module: identifier
12261228

1229+
:required: ``detailed-0.9``
12271230
:disallowed: ``exitcode-stdio-1.0``
12281231

12291232
The module exporting the ``tests`` symbol.
@@ -1244,6 +1247,7 @@ demonstrate the use of the ``exitcode-stdio-1.0`` interface.
12441247
Build-Type: Simple
12451248
12461249
Test-Suite test-foo
1250+
type: exitcode-stdio-1.0
12471251
main-is: test-foo.hs
12481252
build-depends: base >= 4 && < 5
12491253
default-language: Haskell2010
@@ -1278,6 +1282,7 @@ be provided by the library that provides the testing facility.
12781282
Build-Type: Simple
12791283
12801284
Test-Suite test-bar
1285+
type: detailed-0.9
12811286
test-module: Bar
12821287
build-depends: base >= 4 && < 5, Cabal >= 1.9.2 && < 2
12831288
default-language: Haskell2010
@@ -1340,6 +1345,16 @@ Benchmarks
13401345
The benchmark may be described using the following fields, as well as
13411346
build information fields (see the section on `build information`_).
13421347

1348+
.. pkg-field:: type: interface (required until ``cabal-version`` 3.8)
1349+
1350+
The interface type and version of the benchmark. At the moment Cabal
1351+
only support one benchmark interface, called ``exitcode-stdio-1.0``.
1352+
1353+
Benchmarks using the ``exitcode-stdio-1.0`` (default since ``cabal-version`` 3.8) interface are executables
1354+
that indicate failure to run the benchmark with a non-zero exit code
1355+
when run; they may provide human-readable information through the
1356+
standard output and error channels.
1357+
13431358
.. pkg-field:: main-is: filename
13441359

13451360
The name of the ``.hs`` or ``.lhs`` file containing the ``Main``
@@ -1364,6 +1379,7 @@ Example:
13641379
Build-Type: Simple
13651380
13661381
Benchmark bench-foo
1382+
type: exitcode-stdio-1.0
13671383
main-is: bench-foo.hs
13681384
build-depends: base >= 4 && < 5, time >= 1.1 && < 1.7
13691385
default-language: Haskell2010
@@ -2698,6 +2714,7 @@ Starting with Cabal-2.2 it's possible to use common build info stanzas.
26982714

26992715
test-suite tests
27002716
import: deps, test-deps
2717+
type: exitcode-stdio-1.0
27012718
main-is: Tests.hs
27022719
build-depends: foo
27032720
default-language: Haskell2010

0 commit comments

Comments
 (0)