Skip to content

Commit a66b2c5

Browse files
authored
feat(test): add a test utils crate to make log initialization possible everywhere
This PR allows `init_tracing_for_test` to be called by any other crate in the sdk Signed-off-by: multi [[email protected]](mailto:[email protected])
1 parent 69bef9a commit a66b2c5

File tree

22 files changed

+94
-50
lines changed

22 files changed

+94
-50
lines changed

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ matrix-sdk-qrcode = { path = "crates/matrix-sdk-qrcode", version = "0.13.0" }
117117
matrix-sdk-sqlite = { path = "crates/matrix-sdk-sqlite", version = "0.13.0", default-features = false }
118118
matrix-sdk-store-encryption = { path = "crates/matrix-sdk-store-encryption", version = "0.13.0" }
119119
matrix-sdk-test = { path = "testing/matrix-sdk-test", version = "0.13.0" }
120+
matrix-sdk-test-utils = { path = "testing/matrix-sdk-test-utils", version = "0.13.0" }
120121
matrix-sdk-ui = { path = "crates/matrix-sdk-ui", version = "0.13.0", default-features = false }
121122
matrix-sdk-search = { path = "crates/matrix-sdk-search", version = "0.13.0" }
122123

crates/matrix-sdk-base/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ assign = "1.1.1"
9797
futures-executor.workspace = true
9898
http.workspace = true
9999
matrix-sdk-test.workspace = true
100+
matrix-sdk-test-utils.workspace = true
100101
similar-asserts.workspace = true
101102
stream_assert.workspace = true
102103

crates/matrix-sdk-base/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub use utils::{
6969
};
7070

7171
#[cfg(test)]
72-
matrix_sdk_test::init_tracing_for_tests!();
72+
matrix_sdk_test_utils::init_tracing_for_tests!();
7373

7474
/// The Matrix user session info.
7575
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]

crates/matrix-sdk-common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ assert_matches.workspace = true
5555
assert_matches2.workspace = true
5656
insta.workspace = true
5757
matrix-sdk-test-macros = { path = "../../testing/matrix-sdk-test-macros" }
58+
matrix-sdk-test-utils.workspace = true
5859
proptest.workspace = true
5960
wasm-bindgen-test.workspace = true
6061

crates/matrix-sdk-common/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
use std::pin::Pin;
1919

20+
#[cfg(test)]
21+
matrix_sdk_test_utils::init_tracing_for_tests!();
22+
2023
use futures_core::Future;
2124
#[doc(no_inline)]
2225
pub use ruma;

crates/matrix-sdk-crypto/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ http.workspace = true
8888
indoc = "2.0.5"
8989
insta.workspace = true
9090
matrix-sdk-test.workspace = true
91+
matrix-sdk-test-utils.workspace = true
9192
proptest.workspace = true
9293
rmp-serde.workspace = true
9394
similar-asserts.workspace = true

crates/matrix-sdk-crypto/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub use vodozemac;
114114
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
115115

116116
#[cfg(test)]
117-
matrix_sdk_test::init_tracing_for_tests!();
117+
matrix_sdk_test_utils::init_tracing_for_tests!();
118118

119119
#[cfg(feature = "uniffi")]
120120
uniffi::setup_scaffolding!();

crates/matrix-sdk-sqlite/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ matrix-sdk-base = { workspace = true, features = ["testing"] }
4646
matrix-sdk-common.workspace = true
4747
matrix-sdk-crypto = { workspace = true, features = ["testing"] }
4848
matrix-sdk-test.workspace = true
49+
matrix-sdk-test-utils.workspace = true
4950
once_cell.workspace = true
5051
similar-asserts.workspace = true
5152
tempfile.workspace = true

crates/matrix-sdk-sqlite/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub use self::event_cache_store::SqliteEventCacheStore;
4141
pub use self::state_store::{SqliteStateStore, DATABASE_NAME as STATE_STORE_DATABASE_NAME};
4242

4343
#[cfg(test)]
44-
matrix_sdk_test::init_tracing_for_tests!();
44+
matrix_sdk_test_utils::init_tracing_for_tests!();
4545

4646
/// A configuration structure used for opening a store.
4747
#[derive(Clone)]

0 commit comments

Comments
 (0)