Skip to content

Commit

Permalink
bazel: parallelize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jesec committed Jun 30, 2022
1 parent b3ed4f7 commit ea65720
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ cc_binary(
name = "rtorrent",
srcs = [
"src/main.cc",
"//:included_headers",
"@mimalloc",
],
copts = COPTS,
Expand All @@ -109,24 +108,33 @@ cc_binary(
],
)

cc_test(
name = "rtorrent_test",
srcs = glob([
"test/**/*.cc",
]) + [
"@mimalloc",
"//:included_headers",
],
cc_library(
name = "test_common",
srcs = ["test/main.cc"],
copts = COPTS,
includes = ["include"],
linkopts = LINKOPTS,
linkstatic = True,
deps = [
"//:rtorrent_common",
"@com_google_googletest//:gtest",
],
)

[cc_test(
name = t.split("/")[-1][:-3],
srcs = [
t,
"@mimalloc",
],
copts = COPTS,
includes = ["include"],
linkopts = LINKOPTS,
tags = ["rtorrent_test"],
deps = ["//:test_common"],
) for t in glob([
"test/**/test_*.cc",
])]

pkg_tar(
name = "rtorrent-bin",
srcs = ["//:rtorrent"],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ea65720

Please sign in to comment.