Bug 1505859 - Allow rusttests to run when requested without --enable-rust-tests. r=firefox-build-system-reviewers,ted

Differential Revision: https://phabricator.services.mozilla.com/D11514

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Chris Manchester 2018-11-10 14:59:39 +00:00
parent 0a13b40b29
commit 3f10fd4a47
12 changed files with 12 additions and 22 deletions

View File

@ -2,7 +2,6 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
mk_add_options MOZ_MAKE_FLAGS=--output-sync=line
. "$topsrcdir/browser/config/mozconfigs/linux32/nightly"

View File

@ -2,7 +2,6 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
mk_add_options MOZ_MAKE_FLAGS=--output-sync=line
. "$topsrcdir/browser/config/mozconfigs/linux32/debug"

View File

@ -2,7 +2,6 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
mk_add_options MOZ_MAKE_FLAGS=--output-sync=line
. "$topsrcdir/browser/config/mozconfigs/linux64/nightly"

View File

@ -2,7 +2,6 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
mk_add_options MOZ_MAKE_FLAGS=--output-sync=line
. "$topsrcdir/browser/config/mozconfigs/linux64/debug"

View File

@ -2,6 +2,4 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
. "$topsrcdir/browser/config/mozconfigs/win32/nightly"

View File

@ -2,6 +2,4 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
. "$topsrcdir/browser/config/mozconfigs/win32/debug"

View File

@ -2,6 +2,4 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
. "$topsrcdir/browser/config/mozconfigs/win64/nightly"

View File

@ -2,6 +2,4 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
MOZ_AUTOMATION_PACKAGE_TESTS=0
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-rust-tests
. "$topsrcdir/browser/config/mozconfigs/win64/debug"

View File

@ -272,7 +272,7 @@ rustdoc = check_prog('RUSTDOC', add_rustup_path('rustdoc'),
# This option is separate from --enable-tests because Rust tests are particularly
# expensive in terms of compile time (especially for code in libxul).
option('--enable-rust-tests',
help='Enable building of Rust tests, and build-time execution of them')
help='Enable building and running of Rust tests during `make check`')
@depends('--enable-rust-tests', rustdoc)

View File

@ -1074,7 +1074,6 @@ rust_test_flag := --no-fail-fast
force-cargo-test-run:
$(call RUN_CARGO,test $(cargo_target_flag) $(rust_test_flag) $(rust_test_options) $(rust_features_flag),$(rustflags_override) $(RUSTFLAGS),$(target_cargo_env_vars))
check:: force-cargo-test-run
endif
ifdef HOST_RUST_LIBRARY_FILE

View File

@ -1186,7 +1186,11 @@ class RecursiveMakeBackend(CommonBackend):
'HOST_RUST_CARGO_PROGRAMS')
def _process_rust_tests(self, obj, backend_file):
self._no_skip['check'].add(backend_file.relobjdir)
if obj.config.substs.get('MOZ_RUST_TESTS'):
# If --enable-rust-tests has been set, run these as a part of
# make check.
self._no_skip['check'].add(backend_file.relobjdir)
backend_file.write('check:: force-cargo-test-run\n')
build_target = self._build_target_for_obj(obj)
self._compile_graph[build_target]
self._process_non_default_target(obj, 'force-cargo-test-run',

View File

@ -1305,14 +1305,13 @@ class TreeMetadataEmitter(LoggingMixin):
Manifest('components',
mozpath.basename(c)))
if self.config.substs.get('MOZ_RUST_TESTS', None):
rust_tests = context.get('RUST_TESTS', [])
if rust_tests:
# TODO: more sophisticated checking of the declared name vs.
# contents of the Cargo.toml file.
features = context.get('RUST_TEST_FEATURES', [])
rust_tests = context.get('RUST_TESTS', [])
if rust_tests:
# TODO: more sophisticated checking of the declared name vs.
# contents of the Cargo.toml file.
features = context.get('RUST_TEST_FEATURES', [])
yield RustTests(context, rust_tests, features)
yield RustTests(context, rust_tests, features)
for obj in self._process_test_manifests(context):
yield obj