mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-08 18:02:05 +03:00
getdeps: introduce build --enable-tests
option
Summary: This controls whether tests are built or not. They are not built by default. When `--enable-tests` is turned on, tests are enabled for the named project only, not all of the deps. This results in a faster build, because eg: the number of tests in folly is very large and consumers of folly don't want to spend so much time waiting to build tests when really all they want to do is build their own project. Reviewed By: strager Differential Revision: D15246336 fbshipit-source-id: 2e22fd60c983b059f71639602712087f2a188ec6
This commit is contained in:
committed by
Facebook Github Bot
parent
52d9e00c99
commit
9ddb1f7603
@@ -222,6 +222,11 @@ class BuildCmd(SubCmd):
|
||||
install_dirs = []
|
||||
|
||||
for m in projects:
|
||||
ctx = dict(ctx)
|
||||
if args.enable_tests and m.name == manifest.name:
|
||||
ctx["test"] = "on"
|
||||
else:
|
||||
ctx["test"] = "off"
|
||||
fetcher = m.create_fetcher(opts, ctx)
|
||||
|
||||
if args.clean:
|
||||
@@ -287,6 +292,15 @@ class BuildCmd(SubCmd):
|
||||
"slow up-to-date-ness checks"
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--enable-tests",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=(
|
||||
"For the named project, build tests so that the test command "
|
||||
"is able to execute tests"
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@cmd("test", "test a given project")
|
||||
@@ -296,6 +310,7 @@ class TestCmd(SubCmd):
|
||||
manifest = load_project(opts, args.project)
|
||||
|
||||
ctx = context_from_host_tuple()
|
||||
ctx["test"] = "on"
|
||||
projects = manifests_in_dependency_order(opts, manifest, ctx)
|
||||
manifests_by_name = {m.name: m for m in projects}
|
||||
|
||||
|
@@ -24,6 +24,12 @@ zstd
|
||||
[dependencies.any(os=windows, os=darwin)]
|
||||
bison
|
||||
|
||||
[cmake.defines.test=on]
|
||||
BUILD_TESTS=ON
|
||||
|
||||
[cmake.defines.test=off]
|
||||
BUILD_TESTS=OFF
|
||||
|
||||
[shipit.pathmap]
|
||||
fbcode/thrift/public_tld = .
|
||||
fbcode/thrift = thrift
|
||||
|
@@ -49,4 +49,9 @@ fbcode/folly = folly
|
||||
|
||||
[cmake.defines]
|
||||
BUILD_SHARED_LIBS=OFF
|
||||
|
||||
[cmake.defines.test=on]
|
||||
BUILD_TESTS=ON
|
||||
|
||||
[cmake.defines.test=off]
|
||||
BUILD_TESTS=OFF
|
||||
|
@@ -11,9 +11,12 @@ repo_url = https://github.com/facebook/wangle.git
|
||||
builder = cmake
|
||||
subdir = wangle
|
||||
|
||||
[cmake.defines]
|
||||
[cmake.defines.test=on]
|
||||
BUILD_TESTS=ON
|
||||
|
||||
[cmake.defines.test=off]
|
||||
BUILD_TESTS=OFF
|
||||
|
||||
[dependencies]
|
||||
folly
|
||||
googletest
|
||||
|
Reference in New Issue
Block a user