File: BUILD.bazel

package info (click to toggle)
libtoxcore 0.2.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,124 kB
  • sloc: ansic: 75,034; cpp: 4,933; sh: 1,115; python: 651; makefile: 329; perl: 39
file content (124 lines) | stat: -rw-r--r-- 3,189 bytes parent folder | download
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
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")

cc_library(
    name = "fuzz_support",
    srcs = [
        "func_conversion.hh",
        "fuzz_support.cc",
    ],
    hdrs = ["fuzz_support.hh"],
    visibility = ["//c-toxcore:__subpackages__"],
    deps = [
        "//c-toxcore/toxcore:crypto_core",
        "//c-toxcore/toxcore:network",
        "//c-toxcore/toxcore:tox",
    ],
)

cc_library(
    name = "fuzz_tox",
    hdrs = ["fuzz_tox.hh"],
    visibility = ["//c-toxcore:__subpackages__"],
    deps = [":fuzz_support"],
)

cc_fuzz_test(
    name = "bootstrap_fuzz_test",
    size = "small",
    srcs = ["bootstrap_fuzz_test.cc"],
    copts = ["-UNDEBUG"],
    corpus = ["//tools/toktok-fuzzer/corpus:bootstrap_fuzz_test"],
    deps = [
        ":fuzz_support",
        ":fuzz_tox",
        "//c-toxcore/toxcore:tox",
        "//c-toxcore/toxcore:tox_dispatch",
        "//c-toxcore/toxcore:tox_events",
    ],
)

cc_fuzz_test(
    name = "e2e_fuzz_test",
    size = "small",
    srcs = ["e2e_fuzz_test.cc"],
    copts = ["-UNDEBUG"],
    corpus = ["//tools/toktok-fuzzer/corpus:e2e_fuzz_test"],
    data = ["//tools/toktok-fuzzer/init:e2e_fuzz_test.dat"],
    deps = [
        ":fuzz_support",
        ":fuzz_tox",
        "//c-toxcore/toxcore:tox",
        "//c-toxcore/toxcore:tox_dispatch",
        "//c-toxcore/toxcore:tox_events",
    ],
)

cc_fuzz_test(
    name = "toxsave_fuzz_test",
    size = "small",
    srcs = ["toxsave_fuzz_test.cc"],
    copts = ["-UNDEBUG"],
    corpus = ["//tools/toktok-fuzzer/corpus:toxsave_fuzz_test"],
    deps = [
        ":fuzz_support",
        "//c-toxcore/toxcore:tox",
    ],
)

cc_binary(
    name = "protodump",
    srcs = ["protodump.cc"],
    copts = ["-UNDEBUG"],
    deps = [
        ":fuzz_support",
        "//c-toxcore/toxcore:tox",
        "//c-toxcore/toxcore:tox_dispatch",
        "//c-toxcore/toxcore:tox_events",
        "//c-toxcore/toxcore:util",
    ],
)

genrule(
    name = "e2e_fuzz_test_init",
    outs = [
        "e2e_fuzz_test_init.dat",
        "e2e_fuzz_test_bootstrap.dat",
    ],
    cmd = "$(location :protodump) $(location e2e_fuzz_test_init.dat) $(location e2e_fuzz_test_bootstrap.dat)",
    tags = ["manual"],
    tools = [":protodump"],
)

# bazel test --config=asan-libfuzzer //c-toxcore/testing/fuzzing:protodump_reduce_test
cc_test(
    name = "protodump_reduce_test",
    size = "small",
    srcs = ["protodump_reduce.cc"],
    args = ["$(location :e2e_fuzz_test_init.dat)"],
    copts = ["-UNDEBUG"],
    data = [":e2e_fuzz_test_init.dat"],
    tags = ["manual"],
    deps = [
        ":fuzz_support",
        ":fuzz_tox",
        "//c-toxcore/toxcore:tox",
        "//c-toxcore/toxcore:tox_dispatch",
        "//c-toxcore/toxcore:tox_events",
        "@rules_fuzzing//fuzzing:cc_engine",
    ],
)

cc_fuzz_test(
    name = "protodump_reduce",
    size = "small",
    srcs = ["protodump_reduce.cc"],
    copts = ["-UNDEBUG"],
    deps = [
        ":fuzz_support",
        ":fuzz_tox",
        "//c-toxcore/toxcore:tox",
        "//c-toxcore/toxcore:tox_dispatch",
        "//c-toxcore/toxcore:tox_events",
    ],
)