Bug 1373878 - part 1 - add --enable-rust-tests configure option; r=rillian

Because Rust tests require panic=unwind crates and therefore recompiling
all crates we normally use (since most of our crates use panic=abort),
we've elected to enable Rust tests only if the user asks for it.  Hence,
this configure option.

The configure option also enables build-time execution of the crates,
since it's not straightforward to determine at configure time the name
of the test binary Cargo will produce (Cargo produces test binaries of
the form ${NAME}-${HEX_FINGERPRINT}, but there's no way to determine
what ${HEX_FINGERPRINT} is without actually compiling the test binary).
This commit is contained in:
Nathan Froyd 2017-10-02 09:21:22 -04:00
Родитель 6c72c8afb3
Коммит 2d3d2c4950
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -240,3 +240,10 @@ set_config('RUSTC_COMMIT', depends(rustc_info)(lambda i: i.commit))
# Until we remove all the other Rust checks in old-configure. # Until we remove all the other Rust checks in old-configure.
add_old_configure_assignment('RUSTC', rustc) add_old_configure_assignment('RUSTC', rustc)
add_old_configure_assignment('RUST_TARGET', rust_target_triple) add_old_configure_assignment('RUST_TARGET', rust_target_triple)
# 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')
set_config('MOZ_RUST_TESTS', depends('--enable-rust-tests')(lambda v: bool(v)))