mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2024-11-25 01:21:01 +00:00
Fix conditional testing in garage_db
This commit is contained in:
parent
fcaee3bea0
commit
c050a59fd0
1 changed files with 9 additions and 4 deletions
|
@ -1,9 +1,5 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
use crate::lmdb_adapter::LmdbDb;
|
|
||||||
use crate::sled_adapter::SledDb;
|
|
||||||
use crate::sqlite_adapter::SqliteDb;
|
|
||||||
|
|
||||||
fn test_suite(db: Db) {
|
fn test_suite(db: Db) {
|
||||||
let tree = db.open_tree("tree").unwrap();
|
let tree = db.open_tree("tree").unwrap();
|
||||||
|
|
||||||
|
@ -80,7 +76,10 @@ fn test_suite(db: Db) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "lmdb")]
|
||||||
fn test_lmdb_db() {
|
fn test_lmdb_db() {
|
||||||
|
use crate::lmdb_adapter::LmdbDb;
|
||||||
|
|
||||||
let path = mktemp::Temp::new_dir().unwrap();
|
let path = mktemp::Temp::new_dir().unwrap();
|
||||||
let db = heed::EnvOpenOptions::new()
|
let db = heed::EnvOpenOptions::new()
|
||||||
.max_dbs(100)
|
.max_dbs(100)
|
||||||
|
@ -92,7 +91,10 @@ fn test_lmdb_db() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "sled")]
|
||||||
fn test_sled_db() {
|
fn test_sled_db() {
|
||||||
|
use crate::sled_adapter::SledDb;
|
||||||
|
|
||||||
let path = mktemp::Temp::new_dir().unwrap();
|
let path = mktemp::Temp::new_dir().unwrap();
|
||||||
let db = SledDb::init(sled::open(path.to_path_buf()).unwrap());
|
let db = SledDb::init(sled::open(path.to_path_buf()).unwrap());
|
||||||
test_suite(db);
|
test_suite(db);
|
||||||
|
@ -100,7 +102,10 @@ fn test_sled_db() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "sqlite")]
|
||||||
fn test_sqlite_db() {
|
fn test_sqlite_db() {
|
||||||
|
use crate::sqlite_adapter::SqliteDb;
|
||||||
|
|
||||||
let db = SqliteDb::init(rusqlite::Connection::open_in_memory().unwrap());
|
let db = SqliteDb::init(rusqlite::Connection::open_in_memory().unwrap());
|
||||||
test_suite(db);
|
test_suite(db);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue