Skip to content

Commit

Permalink
add #![cfg(any(feature ...))], to reduce warning in cargo test (#2177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hmikihiro authored Apr 17, 2024
1 parent c724ec5 commit a069d46
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/connection_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use common::{bakery_chain::*, setup::*, TestContext};
Expand Down
5 changes: 5 additions & 0 deletions tests/cursor_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use common::{features::*, setup::*, TestContext};
Expand Down
2 changes: 1 addition & 1 deletion tests/json_vec_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub async fn insert_json_struct_vec_derive(db: &DatabaseConnection) -> Result<()
],
};

let result = json_vec.clone().into_active_model().insert(db).await?;
let _result = json_vec.clone().into_active_model().insert(db).await?;

let model = json_vec_derive::json_struct_vec::Entity::find()
.filter(json_vec_derive::json_struct_vec::Column::Id.eq(json_vec.id))
Expand Down
5 changes: 5 additions & 0 deletions tests/loader_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use common::{bakery_chain::*, setup::*, TestContext};
Expand Down
5 changes: 5 additions & 0 deletions tests/partial_model_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
use entity::{Column, Entity};
use sea_orm::{ColumnTrait, DerivePartialModel, EntityTrait, FromQueryResult, ModelTrait};
use sea_query::Expr;
Expand Down
5 changes: 5 additions & 0 deletions tests/pi_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

use common::{features::*, setup::*, TestContext};
Expand Down
5 changes: 5 additions & 0 deletions tests/relational_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use chrono::offset::Utc;
Expand Down
5 changes: 5 additions & 0 deletions tests/returning_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use common::{bakery_chain::*, setup::*, TestContext};
Expand Down
5 changes: 5 additions & 0 deletions tests/self_join_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use common::{features::*, setup::*, TestContext};
Expand Down
5 changes: 5 additions & 0 deletions tests/sequential_op_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use chrono::offset::Utc;
Expand Down
5 changes: 5 additions & 0 deletions tests/time_crate_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;
pub use common::{features::*, setup::*, TestContext};
use pretty_assertions::assert_eq;
Expand Down
5 changes: 5 additions & 0 deletions tests/transaction_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg(any(
feature = "sqlx-mysql",
feature = "sqlx-sqlite",
feature = "sqlx-postgres"
))]
pub mod common;

pub use common::{bakery_chain::*, setup::*, TestContext};
Expand Down

0 comments on commit a069d46

Please sign in to comment.