summaryrefslogtreecommitdiffstats
path: root/toolkit/library/gtest
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/library/gtest')
-rw-r--r--toolkit/library/gtest/moz.build21
-rw-r--r--toolkit/library/gtest/rust/Cargo.toml35
-rw-r--r--toolkit/library/gtest/rust/lib.rs16
-rw-r--r--toolkit/library/gtest/rust/moz.build19
4 files changed, 91 insertions, 0 deletions
diff --git a/toolkit/library/gtest/moz.build b/toolkit/library/gtest/moz.build
new file mode 100644
index 0000000000..f45e2c9c7c
--- /dev/null
+++ b/toolkit/library/gtest/moz.build
@@ -0,0 +1,21 @@
+# -*- Mode: python; 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/.
+
+FINAL_TARGET = "dist/bin/gtest"
+
+if CONFIG["ENABLE_TESTS"]:
+ USE_LIBS += [
+ "gkrust-gtest",
+ ]
+
+USE_LIBS += [
+ "static:xul",
+]
+
+Libxul(
+ "xul-gtest",
+ output_category=None if CONFIG["LINK_GTEST_DURING_COMPILE"] else "gtest",
+)
diff --git a/toolkit/library/gtest/rust/Cargo.toml b/toolkit/library/gtest/rust/Cargo.toml
new file mode 100644
index 0000000000..07208ff986
--- /dev/null
+++ b/toolkit/library/gtest/rust/Cargo.toml
@@ -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 }
+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 = "../../rust/shared" }
+gecko-fuzz-targets = { path = "../../../../tools/fuzzing/rust", optional = true }
+fog-gtest = { path = "../../../components/glean/tests/gtest" }
+dap_ffi-gtest = { path = "../../../components/telemetry/dap/ffi-gtest" }
+dllservices-gtest = { path = "../../../xre/dllservices/tests/gtest/rust" }
+
+# 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
diff --git a/toolkit/library/gtest/rust/lib.rs b/toolkit/library/gtest/rust/lib.rs
new file mode 100644
index 0000000000..218353ee2e
--- /dev/null
+++ b/toolkit/library/gtest/rust/lib.rs
@@ -0,0 +1,16 @@
+// 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 dllservices_gtest;
diff --git a/toolkit/library/gtest/rust/moz.build b/toolkit/library/gtest/rust/moz.build
new file mode 100644
index 0000000000..b1e5b6c692
--- /dev/null
+++ b/toolkit/library/gtest/rust/moz.build
@@ -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("../../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"] = []