summaryrefslogtreecommitdiffhomepage
path: root/pkg/sync/atomicptrmaptest/BUILD
blob: 3f71ae97dcf792b8d9fc8f2b2bebea6af0a063e1 (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
load("//tools:defs.bzl", "go_library", "go_test")
load("//tools/go_generics:defs.bzl", "go_template_instance")

package(
    default_visibility = ["//visibility:private"],
    licenses = ["notice"],
)

go_template_instance(
    name = "test_atomicptrmap",
    out = "test_atomicptrmap_unsafe.go",
    package = "atomicptrmap",
    prefix = "test",
    template = "//pkg/sync:generic_atomicptrmap",
    types = {
        "Key": "int64",
        "Value": "testValue",
    },
)

go_template_instance(
    name = "test_atomicptrmap_sharded",
    out = "test_atomicptrmap_sharded_unsafe.go",
    consts = {
        "ShardOrder": "4",
    },
    package = "atomicptrmap",
    prefix = "test",
    suffix = "Sharded",
    template = "//pkg/sync:generic_atomicptrmap",
    types = {
        "Key": "int64",
        "Value": "testValue",
    },
)

go_library(
    name = "atomicptrmap",
    testonly = 1,
    srcs = [
        "atomicptrmap.go",
        "test_atomicptrmap_sharded_unsafe.go",
        "test_atomicptrmap_unsafe.go",
    ],
    deps = [
        "//pkg/gohacks",
        "//pkg/sync",
    ],
)

go_test(
    name = "atomicptrmap_test",
    size = "small",
    srcs = ["atomicptrmap_test.go"],
    library = ":atomicptrmap",
    deps = ["//pkg/sync"],
)