mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
meson: respect 'tests' build option in contrib
Both the "netrc" credential helper and git-subtree(1) from "contrib/" carry a couple of tests with them. These tests get wired up in Meson unconditionally even in the case where `-Dtests=false`. As those tests depend on the `test_enviroment` variable, which only gets defined in case `-Dtests=true`, the result is an error: ``` $ meson setup -Dtests=false -Dcontrib=subtree build [...] contrib/subtree/meson.build:15:27: ERROR: Unknown variable "test_environment". ``` Fix the issue by not defining these tests at all in case the "tests" option is set to `false`. Reported-by: Sam James <sam@gentoo.org> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
c0d3f90ef5
commit
bdd04b91c3
@@ -7,14 +7,16 @@ credential_netrc = custom_target(
|
||||
install_dir: get_option('libexecdir') / 'git-core',
|
||||
)
|
||||
|
||||
credential_netrc_testenv = test_environment
|
||||
credential_netrc_testenv.set('CREDENTIAL_NETRC_PATH', credential_netrc.full_path())
|
||||
if get_option('tests')
|
||||
credential_netrc_testenv = test_environment
|
||||
credential_netrc_testenv.set('CREDENTIAL_NETRC_PATH', credential_netrc.full_path())
|
||||
|
||||
test('t-git-credential-netrc',
|
||||
shell,
|
||||
args: [ meson.current_source_dir() / 't-git-credential-netrc.sh' ],
|
||||
workdir: meson.current_source_dir(),
|
||||
env: credential_netrc_testenv,
|
||||
depends: test_dependencies + bin_wrappers + [credential_netrc],
|
||||
timeout: 0,
|
||||
)
|
||||
test('t-git-credential-netrc',
|
||||
shell,
|
||||
args: [ meson.current_source_dir() / 't-git-credential-netrc.sh' ],
|
||||
workdir: meson.current_source_dir(),
|
||||
env: credential_netrc_testenv,
|
||||
depends: test_dependencies + bin_wrappers + [credential_netrc],
|
||||
timeout: 0,
|
||||
)
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user