Skip to content

Commit

Permalink
build: Treat unit tests warnings as errors
Browse files Browse the repository at this point in the history
Turn on the rustc flag "-Dwarnings" for all bazel rust tests so that all
warnings would show up as errors.

Signed-off-by: Sebastien Boeuf <[email protected]>
  • Loading branch information
sboeuf authored and dgreid committed Apr 5, 2023
1 parent de4dcd1 commit 6c1ce9d
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ rust_test(
"-Ctarget-feature=+v",
"-Clink-arg=-Tsrc/salus-test.lds",
"--codegen=link-arg=-nostartfiles",
"-Dwarnings",
],
deps = salus_deps,
)
3 changes: 3 additions & 0 deletions data-model/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ rust_test(
name = "data-model-test",
testonly = True,
crate = ":data-model",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions device-tree/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ rustfmt_test(
rust_test(
name = "device-tree-test",
crate = ":device-tree",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions drivers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ rustfmt_test(
rust_test(
name = "drivers-test",
crate = ":drivers",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions hyp-alloc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ rustfmt_test(
rust_test(
name = "hyp-alloc-test",
crate = ":hyp-alloc",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions mtt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ rustfmt_test(
rust_test(
name = "mtt-test",
crate = ":mtt",
rustc_flags = [
"-Dwarnings",
],
)
3 changes: 3 additions & 0 deletions page-tracking/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ rustfmt_test(
rust_test(
name = "page-tracking-test",
crate = ":page-tracking",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions riscv-elf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ rustfmt_test(
rust_test(
name = "riscv-elf-test",
crate = ":riscv-elf",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions riscv-page-tables/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ rustfmt_test(
rust_test(
name = "riscv-page-tables-test",
crate = ":riscv-page-tables",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down
3 changes: 3 additions & 0 deletions riscv-pages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ rustfmt_test(
rust_test(
name = "riscv-pages-test",
crate = ":riscv-pages",
rustc_flags = [
"-Dwarnings",
],
)

rust_doc(
Expand Down

0 comments on commit 6c1ce9d

Please sign in to comment.