// 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 https://mozilla.org/MPL/2.0/.
use std::sync::{Mutex, MutexGuard};
usecrate::private::Ping; use once_cell::sync::Lazy;
/// UGLY HACK. /// We use a global lock to force synchronization of all tests, even if run multi-threaded. /// This allows us to run without `--test-threads 1`.` pubfn lock_test() -> (MutexGuard<'static, ()>, tempfile::TempDir) { static GLOBAL_LOCK: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
// Create a new instance of Glean with a temporary directory. // We need to keep the `TempDir` alive, so that it's not deleted before we stop using it. fn setup_glean(tempdir: Option<tempfile::TempDir>) -> tempfile::TempDir { let dir = match tempdir {
Some(tempdir) => tempdir,
None => tempfile::tempdir().unwrap(),
}; let tmpname = dir.path().to_path_buf();
let cfg = glean::ConfigurationBuilder::new(true, tmpname, GLOBAL_APPLICATION_ID).build();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.