gecko-dev/modules/libpref/test
Nicholas Nethercote 12640bca82 Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium
This patch introduces a new Rust crate called `static_prefs`.

It also changes generate_static_pref_list.py to generate two new files.

- StaticPrefsCGetters.cpp: contains C getters, which are just wrappers around
  the C++ getters. This is included into Preferences.cpp.

- static_prefs.rs: contains declarations for the C getters, plus the `pref!`
  macro which provides nice syntax for calling the C getters. This is included
  into static_prefs/src/lib.rs.

The new code is only generated for prefs marked with the new `rust` field in
the YAML. It's opt-in because there's no point generating additional code for
900+ static prefs when only about 20 are currently used from Rust.

This patch only marks a single pref (`browser.display.document_color_use`) with
`rust: true`. That pref isn't accessed from Rust code in this patch, but it's
necessary because the generated Rust code is invalid if there are zero
Rust-accessed prefs. (The next patch will access that pref and others from Rust
code.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 05:16:55 +00:00
..
gtest Bug 1569526 - Remove return values from Add*VarCache(). r=KrisWright 2019-07-30 06:19:46 +00:00
unit Bug 1561435 - Format modules/, a=automatic-formatting 2019-07-05 10:54:01 +02:00
unit_ipc Bug 1561435 - Format modules/, a=automatic-formatting 2019-07-05 10:54:01 +02:00
python.ini Bug 1564724 - Generate StaticPrefList.h from StaticPrefList.yaml. r=glandium 2019-07-18 00:08:20 +00:00
test_generate_static_pref_list.py Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium 2019-08-07 05:16:55 +00:00