Skip to content

Commit

Permalink
Add :dialyze_tests for bazel
Browse files Browse the repository at this point in the history
runs the dialyzer against the test suites
  • Loading branch information
HoloRin committed May 24, 2023
1 parent bc228c2 commit 27ec4ae
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
40 changes: 33 additions & 7 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ test_erlang_app(

xref()

PLT_APPS = DEFAULT_PLT_APPS + [
"compiler",
"tools",
"runtime_tools",
"mnesia",
"eunit",
]

plt(
name = "deps_plt",
apps = DEFAULT_PLT_APPS + [
"compiler",
"tools",
"runtime_tools",
"mnesia",
"eunit",
],
apps = PLT_APPS,
for_target = ":erlang_app",
)

Expand All @@ -53,6 +55,30 @@ dialyze(
plt = ":deps_plt",
)

plt(
name = "test_deps_plt",
apps = PLT_APPS + [
"common_test",
],
for_target = ":test_erlang_app",
deps = [
"@meck//:erlang_app",
"@proper//:erlang_app",
],
)

dialyze(
name = "dialyze_tests",
size = "small",
beam = [
f.replace("test/", "").replace(".erl", "_beam_files")
for f in glob(["test/*_SUITE.erl"])
] + [
":test_helpers",
],
plt = ":test_deps_plt",
)

eunit(
name = "eunit",
eunit_opts = [
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module(

bazel_dep(
name = "rules_erlang",
version = "3.10.2",
version = "3.10.5",
)

erlang_config = use_extension(
Expand Down
1 change: 1 addition & 0 deletions ra.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def ra_suites():

erlang_bytecode(
name = "test_helpers",
erlc_opts = TEST_ERLC_OPTS,
srcs = helpers,
hdrs = hdrs,
deps = [
Expand Down

0 comments on commit 27ec4ae

Please sign in to comment.