-
Notifications
You must be signed in to change notification settings - Fork 96
/
ra.bzl
50 lines (45 loc) · 1.24 KB
/
ra.bzl
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
load("@rules_erlang//:erlang_bytecode.bzl", "erlang_bytecode")
load("@rules_erlang//:ct.bzl", "ct_suite")
TEST_ERLC_OPTS = [
"-DTEST",
"+debug_info",
"+nowarn_export_all",
]
def ra_suites():
suites = native.glob(["test/*_SUITE.erl"])
helpers = native.glob(["test/*.erl"], exclude = suites)
hdrs = [
"src/ra.hrl",
"src/ra_server.hrl",
]
erlang_bytecode(
name = "test_helpers",
erlc_opts = TEST_ERLC_OPTS,
srcs = helpers,
hdrs = hdrs,
deps = [
":test_erlang_app",
],
dest = "test",
testonly = True,
)
for file in suites:
name = file.replace("test/", "").replace(".erl", "")
ct_suite(
erlc_opts = TEST_ERLC_OPTS,
name = name,
runtime_deps = [
"@gen_batch_server//:erlang_app",
"@aten//:erlang_app",
"@seshat//:erlang_app",
"@inet_tcp_proxy_dist//:erlang_app",
"@meck//:erlang_app",
],
deps = [
"@proper//:erlang_app",
],
additional_hdrs = hdrs,
additional_beam = [
":test_helpers",
],
)