Bug 1888234 - Thunderbird variant of libxul-gtest with EWS Rust code. r=ikey

Requires D211380 on mozilla-central.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Lemley 2024-05-30 14:52:03 +00:00
Родитель 145361a3af
Коммит f143a7124b
6 изменённых файлов: 177 добавлений и 1 удалений

99
rust/Cargo.lock сгенерированный
Просмотреть файл

@ -352,6 +352,14 @@ dependencies = [
"serde",
]
[[package]]
name = "bench-collections-gtest"
version = "0.1.0"
dependencies = [
"fnv",
"fxhash",
]
[[package]]
name = "bhttp"
version = "0.3.1"
@ -1052,6 +1060,18 @@ dependencies = [
"thin-vec",
]
[[package]]
name = "dap_ffi-gtest"
version = "0.1.0"
dependencies = [
"dap_ffi",
"hex",
"prio",
"serde",
"serde_json",
"thin-vec",
]
[[package]]
name = "darling"
version = "0.20.1"
@ -1691,6 +1711,15 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "fog-gtest"
version = "0.1.0"
dependencies = [
"firefox-on-glean",
"jog",
"nsstring",
]
[[package]]
name = "fog_control"
version = "0.1.0"
@ -1862,6 +1891,17 @@ dependencies = [
"byteorder",
]
[[package]]
name = "gecko-fuzz-targets"
version = "0.1.0"
dependencies = [
"lazy_static",
"libc",
"lmdb-rkv",
"rkv",
"tempfile",
]
[[package]]
name = "gecko-profiler"
version = "0.1.0"
@ -2039,6 +2079,27 @@ dependencies = [
"xpcom",
]
[[package]]
name = "gkrust-gtest"
version = "0.1.0"
dependencies = [
"bench-collections-gtest",
"dap_ffi-gtest",
"ews_xpcom",
"fog-gtest",
"gecko-fuzz-targets",
"gkrust-shared",
"l10nregistry-ffi-gtest",
"lmdb-rkv-sys",
"moz_task-gtest",
"mozglue-static",
"mozilla-central-workspace-hack",
"mp4parse-gtest",
"nsstring-gtest",
"swgl",
"xpcom-gtest",
]
[[package]]
name = "gkrust-shared"
version = "0.1.0"
@ -2363,6 +2424,9 @@ name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
dependencies = [
"serde",
]
[[package]]
name = "hexf-parse"
@ -2718,6 +2782,14 @@ dependencies = [
"xpcom",
]
[[package]]
name = "l10nregistry-ffi-gtest"
version = "0.1.0"
dependencies = [
"l10nregistry-ffi",
"moz_task",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
@ -3187,6 +3259,13 @@ dependencies = [
"xpcom",
]
[[package]]
name = "moz_task-gtest"
version = "0.1.0"
dependencies = [
"moz_task",
]
[[package]]
name = "mozannotation_client"
version = "0.1.0"
@ -3247,6 +3326,10 @@ dependencies = [
"static_assertions",
]
[[package]]
name = "mp4parse-gtest"
version = "0.1.0"
[[package]]
name = "mp4parse_capi"
version = "0.17.0"
@ -3458,6 +3541,13 @@ dependencies = [
"encoding_rs",
]
[[package]]
name = "nsstring-gtest"
version = "0.1.0"
dependencies = [
"nsstring",
]
[[package]]
name = "num-derive"
version = "0.4.2"
@ -5836,6 +5926,15 @@ dependencies = [
"xpcom_macros",
]
[[package]]
name = "xpcom-gtest"
version = "0.1.0"
dependencies = [
"nserror",
"nsstring",
"xpcom",
]
[[package]]
name = "xpcom_async"
version = "0.1.0"

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

@ -6,10 +6,11 @@ description = "Thunderbird extensions to mozilla-central-workspace-hack"
[features]
gkrust = []
gkrust-gtest = ["gkrust"]
[workspace]
members = ['xpcom_async', 'moz_http', 'gkrust', 'ews_xpcom']
members = ['xpcom_async', 'moz_http', 'gkrust', 'ews_xpcom', 'gtest']
[workspace.dependencies]
uniffi = { version = "0.27.1" }

35
rust/gtest/Cargo.toml Normal file
Просмотреть файл

@ -0,0 +1,35 @@
[package]
name = "gkrust-gtest"
version = "0.1.0"
authors = ["The Mozilla Project Developers"]
license = "MPL-2.0"
description = "Testing code for libgkrust"
[dependencies]
mozilla-central-workspace-hack = { version = "0.1", features = ["gkrust-gtest"], optional = true }
ews_xpcom = { version = "0.1.0", path = "../ews_xpcom" }
bench-collections-gtest = { path = "../../../xpcom/rust/gtest/bench-collections" }
l10nregistry-ffi-gtest = { path = "../../../intl/l10n/rust/gtest" }
moz_task-gtest = { path = "../../../xpcom/rust/gtest/moz_task" }
mp4parse-gtest = { path = "../../../dom/media/gtest" }
nsstring-gtest = { path = "../../../xpcom/rust/gtest/nsstring" }
xpcom-gtest = { path = "../../../xpcom/rust/gtest/xpcom" }
gkrust-shared = { path = "../../../toolkit/library/rust/shared" }
gecko-fuzz-targets = { path = "../../../tools/fuzzing/rust", optional = true }
fog-gtest = { path = "../../../toolkit/components/glean/tests/gtest" }
dap_ffi-gtest = { path = "../../../toolkit/components/telemetry/dap/ffi-gtest" }
# Workarounds for https://github.com/rust-lang/rust/issues/58393
mozglue-static = { path = "../../../mozglue/static/rust" }
swgl = { path = "../../../gfx/wr/swgl" }
lmdb-rkv-sys = "0.11"
[lib]
path = "lib.rs"
crate-type = ["staticlib"]
test = false
doctest = false
bench = false
doc = false
plugin = false
harness = false

17
rust/gtest/lib.rs Normal file
Просмотреть файл

@ -0,0 +1,17 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
extern crate bench_collections_gtest;
extern crate dap_ffi_gtest;
extern crate fog_gtest;
#[cfg(feature = "gecko-fuzz-targets")]
extern crate gecko_fuzz_targets;
extern crate gkrust_shared;
extern crate l10nregistry_ffi_gtest;
extern crate moz_task_gtest;
extern crate mp4parse_gtest;
extern crate nsstring_gtest;
extern crate xpcom_gtest;
extern crate ews_xpcom;

19
rust/gtest/moz.build Normal file
Просмотреть файл

@ -0,0 +1,19 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include("/toolkit/library/rust/gkrust-features.mozbuild")
if CONFIG["LIBFUZZER"]:
gkrust_features += ["gecko-fuzz-targets"]
RustLibrary(
"gkrust-gtest",
gkrust_features,
output_category=None if CONFIG["LINK_GTEST_DURING_COMPILE"] else "gtest",
)
COMPILE_FLAGS["BASE_INCLUDES"] = []
HOST_COMPILE_FLAGS["BASE_INCLUDES"] = []

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

@ -6,3 +6,8 @@
DIRS += [
"gkrust",
]
if CONFIG["ENABLE_TESTS"]:
DIRS += [
"gtest",
]