mirror of https://github.com/ArduPilot/ardupilot
waf: allow to disable tests
This allows to completely disable the tests. Even the gtest submodule is not checked out allowing integration on build servers without needing to download one more submodule. This is different from the --notests flag. The latter only disables executing the tests, but always use the submodule.
This commit is contained in:
parent
8967220652
commit
b375b33189
|
@ -11,6 +11,10 @@ from waflib.Configure import conf
|
||||||
import boards
|
import boards
|
||||||
|
|
||||||
def configure(cfg):
|
def configure(cfg):
|
||||||
|
cfg.env.HAS_GTEST = False
|
||||||
|
if cfg.options.disable_tests:
|
||||||
|
return
|
||||||
|
|
||||||
board = cfg.get_board()
|
board = cfg.get_board()
|
||||||
if isinstance(board, boards.px4):
|
if isinstance(board, boards.px4):
|
||||||
# toolchain is currently broken for gtest
|
# toolchain is currently broken for gtest
|
||||||
|
@ -21,8 +25,6 @@ def configure(cfg):
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
cfg.env.HAS_GTEST = False
|
|
||||||
|
|
||||||
if cfg.env.STATIC_LINKING:
|
if cfg.env.STATIC_LINKING:
|
||||||
# gtest uses a function (getaddrinfo) that is supposed to be linked
|
# gtest uses a function (getaddrinfo) that is supposed to be linked
|
||||||
# dynamically
|
# dynamically
|
||||||
|
|
5
wscript
5
wscript
|
@ -90,6 +90,10 @@ revisions.
|
||||||
default=False,
|
default=False,
|
||||||
help="Don't use libiio even if supported by board and dependencies available")
|
help="Don't use libiio even if supported by board and dependencies available")
|
||||||
|
|
||||||
|
g.add_option('--disable-tests', action='store_true',
|
||||||
|
default=False,
|
||||||
|
help="Disable compilation and test execution")
|
||||||
|
|
||||||
g.add_option('--static',
|
g.add_option('--static',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -235,6 +239,7 @@ def _build_common_taskgens(bld):
|
||||||
use='mavlink',
|
use='mavlink',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if bld.env.HAS_GTEST:
|
||||||
bld.libgtest(cxxflags=['-include', 'ap_config.h'])
|
bld.libgtest(cxxflags=['-include', 'ap_config.h'])
|
||||||
|
|
||||||
if bld.env.HAS_GBENCHMARK:
|
if bld.env.HAS_GBENCHMARK:
|
||||||
|
|
Loading…
Reference in New Issue