about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tests/haskell_doctest/BUILD.bazel
blob: c1d4e527aefc2dc0716bdb6a2188d46de2a76c6b (plain) (blame)
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
load(
    "@io_tweag_rules_haskell//haskell:haskell.bzl",
    "haskell_doctest",
    "haskell_library",
    "haskell_test",
)

package(default_testonly = 1)

haskell_library(
    name = "lib-a",
    srcs = ["Foo.hs"],
    tags = ["requires_zlib"],
    deps = [
        "//tests/data:ourclibrary",
        "//tests/hackage:base",
        "@zlib.dev//:zlib",
    ],
)

haskell_library(
    name = "lib-b",
    srcs = [
        "Bar.hs",
        "Baz.hs",
        "Quux.hsc",
    ],
    tags = ["requires_zlib"],
    deps = [
        ":lib-a",
        "//tests/hackage:base",
    ],
)

haskell_doctest(
    name = "doctest-lib-all-fail",
    tags = ["manual"],  # must FAIL
    visibility = ["//visibility:public"],
    deps = [":lib-b"],
)

haskell_doctest(
    name = "doctest-lib-all-success",
    doctest_flags = ["-DMAGIC_DOCTEST_THING"],
    tags = ["requires_doctest"],
    visibility = ["//visibility:public"],
    deps = [":lib-b"],
)

haskell_doctest(
    name = "doctest-lib",
    modules = ["Bar"],  # exclude Baz and succeed
    tags = ["requires_doctest"],
    visibility = ["//visibility:public"],
    deps = [":lib-b"],
)

haskell_test(
    name = "bin",
    srcs = ["Main.hs"],
    tags = ["requires_zlib"],
    deps = [
        ":lib-a",
        "//tests/hackage:base",
    ],
)

haskell_doctest(
    name = "doctest-bin",
    tags = ["requires_doctest"],
    visibility = ["//visibility:public"],
    deps = [":bin"],
)