mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-07 07:02:53 +03:00
getdeps: update run_cmake.py to also support running tests
Summary: Add a `--mode=tests` behavior for invoking `ctest` Reviewed By: simpkins Differential Revision: D17610033 fbshipit-source-id: 6284fe1dbfb7adf38a67820c842a5531eefd72fa
This commit is contained in:
committed by
Facebook Github Bot
parent
b072f4002f
commit
17d9c5e006
@@ -206,6 +206,7 @@ import subprocess
|
||||
import sys
|
||||
|
||||
CMAKE = {cmake!r}
|
||||
CTEST = {ctest!r}
|
||||
SRC_DIR = {src_dir!r}
|
||||
BUILD_DIR = {build_dir!r}
|
||||
INSTALL_DIR = {install_dir!r}
|
||||
@@ -224,7 +225,7 @@ def main():
|
||||
)
|
||||
ap.add_argument(
|
||||
"--mode",
|
||||
choices=["configure", "build", "install"],
|
||||
choices=["configure", "build", "install", "test"],
|
||||
default="configure",
|
||||
help="The mode to run: configure, build, or install. "
|
||||
"Defaults to configure",
|
||||
@@ -243,6 +244,13 @@ def main():
|
||||
dest="mode",
|
||||
help="An alias for --mode=install",
|
||||
)
|
||||
ap.add_argument(
|
||||
"--test",
|
||||
action="store_const",
|
||||
const="test",
|
||||
dest="mode",
|
||||
help="An alias for --mode=test",
|
||||
)
|
||||
args = ap.parse_args()
|
||||
|
||||
# Strip off a leading "--" from the additional CMake arguments
|
||||
@@ -264,6 +272,8 @@ def main():
|
||||
"--config",
|
||||
"Release",
|
||||
] + args.cmake_args
|
||||
elif args.mode == "test":
|
||||
full_cmd = CMD_PREFIX + [CTEST] + args.cmake_args
|
||||
else:
|
||||
ap.error("unknown invocation mode: %s" % (args.mode,))
|
||||
|
||||
@@ -396,6 +406,7 @@ if __name__ == "__main__":
|
||||
self._write_build_script(
|
||||
cmd_prefix=self._get_cmd_prefix(),
|
||||
cmake=cmake,
|
||||
ctest=path_search(env, "ctest"),
|
||||
env=env,
|
||||
define_args=define_args,
|
||||
src_dir=self.src_dir,
|
||||
|
Reference in New Issue
Block a user